fix(ui): fix clickmap card items selectors
This commit is contained in:
parent
a4f0b323c5
commit
26100b81e6
1 changed files with 3 additions and 2 deletions
|
|
@ -138,7 +138,8 @@ export default abstract class BaseScreen {
|
||||||
getElementBySelector(selector: string): Element | null {
|
getElementBySelector(selector: string): Element | null {
|
||||||
if (!selector) return null;
|
if (!selector) return null;
|
||||||
try {
|
try {
|
||||||
return this.document?.querySelector(selector) || null;
|
const safeSelector = selector.replace(/:/g, '\\\\3A ').replace(/\//g, '\\/');
|
||||||
|
return this.document?.querySelector(safeSelector) || null;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Can not select element. ", e)
|
console.error("Can not select element. ", e)
|
||||||
return null
|
return null
|
||||||
|
|
@ -186,4 +187,4 @@ export default abstract class BaseScreen {
|
||||||
clean() {
|
clean() {
|
||||||
window.removeEventListener('resize', this.scale);
|
window.removeEventListener('resize', this.scale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue