fix: do not show tooltip with only spaces
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

Co-authored-by: David Larlet <david@larlet.fr>
This commit is contained in:
Yohan Boniface 2025-02-27 19:28:38 +01:00
parent ba20f5791c
commit 48daa0a77f

View file

@ -335,15 +335,15 @@ class Feature {
// Variables mode. // Variables mode.
if (labelKey) { if (labelKey) {
if (Utils.hasVar(labelKey)) { if (Utils.hasVar(labelKey)) {
return Utils.greedyTemplate(labelKey, this.extendedProperties()) return Utils.greedyTemplate(labelKey, this.extendedProperties()).trim()
} }
keys.unshift(labelKey) keys.unshift(labelKey)
} }
for (const key of keys) { for (const key of keys) {
const value = this.properties[key] const value = this.properties[key]
if (value) return value if (value) return value.trim()
} }
return this.datalayer.getName() return this.datalayer.getName().trim()
} }
hasPopupFooter() { hasPopupFooter() {