fix(mass-input): properly escape query selector
This commit is contained in:
parent
c404ce9b35
commit
9a3f401b38
@ -4,6 +4,8 @@ import { I18n } from './services/i18n/i18n';
|
||||
import { UtilRegistry } from './services/util-registry/util-registry';
|
||||
import { isValidUtility } from './core/utility';
|
||||
|
||||
import 'css.escape';
|
||||
|
||||
import './app.sass';
|
||||
|
||||
export class App {
|
||||
|
||||
@ -230,7 +230,7 @@ export class MassInput {
|
||||
const extraneousKeys = new Set();
|
||||
for (const k of rawFormData.keys()) {
|
||||
const n = k.replace(/\[\]$/, '');
|
||||
const inputElements = Array.from(this._massInputForm.querySelectorAll(`[name=${n}]`));
|
||||
const inputElements = Array.from(this._massInputForm.querySelectorAll(`[name="${CSS.escape(n)}"]`));
|
||||
const isBelowMassinput = inputElements.some((elem) => this._element.contains(elem));
|
||||
const isFile = inputElements.some((elem) => elem.type === 'file');
|
||||
|
||||
|
||||
5
package-lock.json
generated
5
package-lock.json
generated
@ -7069,6 +7069,11 @@
|
||||
"integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==",
|
||||
"dev": true
|
||||
},
|
||||
"css.escape": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz",
|
||||
"integrity": "sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s="
|
||||
},
|
||||
"cssdb": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/cssdb/-/cssdb-4.4.0.tgz",
|
||||
|
||||
@ -120,6 +120,7 @@
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@juggle/resize-observer": "^2.5.0",
|
||||
"core-js": "^3.6.5",
|
||||
"css.escape": "^1.5.1",
|
||||
"js-cookie": "^2.2.1",
|
||||
"lodash.debounce": "^4.0.8",
|
||||
"lodash.defer": "^4.1.0",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user