dropdown: fix label init, make it dynamic prop, refresh it when values are parsed

This commit is contained in:
jean-emmanuel 2025-08-12 09:20:26 +02:00
parent 5b9bcd63ce
commit 7d38418a66
2 changed files with 8 additions and 2 deletions

View file

@ -4,6 +4,7 @@
- bug fixes
- firefox: `onTouch` error when the cursor goes outside the page
- dropdown: label not initialized until a value is set
- client
- add `title` client option

View file

@ -83,6 +83,8 @@ class Dropdown extends MenuBase {
`)
}
this.setValue(this.value)
}
setValue(v,options={}) {
@ -120,7 +122,9 @@ class Dropdown extends MenuBase {
this.parseValues()
this.setValue(this.value)
return
case 'label':
this.setLabel()
return
}
return ret
@ -130,7 +134,8 @@ class Dropdown extends MenuBase {
}
Dropdown.dynamicProps = Dropdown.prototype.constructor.dynamicProps.concat(
'values'
'values',
'label'
)