fix: do not consume ctrl-Z in textarea or input (#2441)
Some checks failed
Test & Docs / tests (postgresql, 3.10) (push) Has been cancelled
Test & Docs / tests (postgresql, 3.12) (push) Has been cancelled
Test & Docs / lint (push) Has been cancelled
Test & Docs / docs (push) Has been cancelled

fix #2422
This commit is contained in:
Yohan Boniface 2025-01-22 10:40:26 +01:00 committed by GitHub
commit 8a207afaea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View file

@ -541,7 +541,13 @@ export default class Umap extends ServerStored {
if (SAVEMANAGER.isDirty) this.saveAll() if (SAVEMANAGER.isDirty) this.saveAll()
break break
case 'z': case 'z':
if (SAVEMANAGER.isDirty) this.askForReset() if (Utils.isWritable(event.target)) {
used = false
break
}
if (SAVEMANAGER.isDirty) {
this.askForReset()
}
break break
case 'm': case 'm':
this._leafletMap.editTools.startMarker() this._leafletMap.editTools.startMarker()

View file

@ -465,6 +465,12 @@ export class WithEvents {
} }
} }
export function isWritable(element) {
if (['TEXTAREA', 'INPUT'].includes(element.tagName)) return true
if (element.isContentEditable) return true
return false
}
export const COLORS = [ export const COLORS = [
'Black', 'Black',
'Navy', 'Navy',