fix: UiText auto-height on setValue when element not yet rendered
Add requestAnimationFrame deferred handleInput() call in setValue() to ensure textarea height recalculates after DOM render, fixing single-line display when value is set during Form build phase.
This commit is contained in:
parent
d1661e7ab6
commit
8109292f8a
BIN
bricks/.nfs0000000003108f9f00000002
Normal file
BIN
bricks/.nfs0000000003108f9f00000002
Normal file
Binary file not shown.
@ -992,6 +992,14 @@ bricks.UiText =class extends bricks.UiType {
|
||||
this.dom_element.value = v;
|
||||
debug('UiText: v=', v);
|
||||
this.handleInput();
|
||||
// Defer re-calc in case element wasn't rendered yet (e.g. during Form build)
|
||||
if (!this._resizeScheduled) {
|
||||
this._resizeScheduled = true;
|
||||
requestAnimationFrame(() => {
|
||||
this._resizeScheduled = false;
|
||||
this.handleInput();
|
||||
});
|
||||
}
|
||||
}
|
||||
reset(){
|
||||
var v = this.opts.value || this.opts.defaultvalue||'';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user