Skip to content
Open
28 changes: 28 additions & 0 deletions packages/fiori/src/UploadCollectionItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ class UploadCollectionItem extends ListItem {
async onDetailClick() {
super.onDetailClick();
this._editing = true;
this._editMode = true;

await this._initInputField();
}
Expand Down Expand Up @@ -300,6 +301,7 @@ class UploadCollectionItem extends ListItem {
this.fireDecoratorEvent("rename");

this._editing = false;
this._editMode = false;
this._focus();
}

Expand All @@ -311,6 +313,7 @@ class UploadCollectionItem extends ListItem {

async _onRenameCancel(e: KeyboardEvent | UI5CustomEvent<Button, "click">) {
this._editing = false;
this._editMode = false;

if (isEscape(e as KeyboardEvent)) {
await renderFinished();
Expand All @@ -326,6 +329,31 @@ class UploadCollectionItem extends ListItem {
}
}

_handleTabNext(e: KeyboardEvent) {
if (this._editMode) {
return super._handleTabNext(e);
}

if (this.shouldForwardTabAfter()) {
if (!this.fireDecoratorEvent("forward-after")) {
e.preventDefault();
}
}
}

_handleTabPrevious(e: KeyboardEvent) {
if (this._editMode) {
return super._handleTabPrevious(e);
}

const target = e.target as HTMLElement;
if (this.shouldForwardTabBefore(target)) {
if (!this.fireDecoratorEvent("forward-before")) {
e.preventDefault();
}
}
}

_focus() {
this.fireDecoratorEvent("focus-requested");
}
Expand Down
Loading
Loading