Skip to content

Commit 5e2c0fd

Browse files
authored
fix(ui5-file-uploader): adjust tokenizer expand/collapse behaviour (#11985)
Issue: - The internal ui5-tokenizer collapses when focus moves from the tokens to the file uploader. Another precondition is to have all the tokens in the more popover when the file uploader ins't focused.
1 parent cfdce92 commit 5e2c0fd

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

packages/main/src/FileUploader.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,6 @@ class FileUploader extends UI5Element implements IFormInputElement {
283283
@property({ type: Boolean, noAttribute: true })
284284
_tokenizerOpen = false;
285285

286-
@property({ type: Boolean, noAttribute: true })
287-
_tokenizerExpanded = true;
288-
289286
static emptyInput: HTMLInputElement;
290287

291288
@i18n("@ui5/webcomponents")
@@ -397,12 +394,24 @@ class FileUploader extends UI5Element implements IFormInputElement {
397394

398395
_onfocusin() {
399396
this.focused = true;
400-
this._tokenizerExpanded = true;
397+
if (this._tokenizer) {
398+
this._tokenizer.expanded = true;
399+
}
401400
}
402401

403402
_onfocusout() {
404403
this.focused = false;
405-
this._tokenizerExpanded = this._tokenizerOpen || false;
404+
if (this._tokenizer) {
405+
this._tokenizer.expanded = this._tokenizerOpen;
406+
}
407+
}
408+
409+
get _tokenizerExpanded(): boolean {
410+
if (!this._tokenizer) {
411+
return true;
412+
}
413+
414+
return this._tokenizer.expanded;
406415
}
407416

408417
_onTokenizerKeyUp(e: KeyboardEvent) {

0 commit comments

Comments
 (0)