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