Skip to content

Commit

Permalink
fix(ui5-list): remove focus trap for empty list (#2411)
Browse files Browse the repository at this point in the history
  • Loading branch information
fifoosid committed Nov 30, 2020
1 parent 37ee83f commit 5f8e0e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions packages/main/src/List.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
</header>
{{/if}}

<div id="{{_id}}-before" tabindex="0" class="ui5-list-focusarea"></div>
{{#if hasData}}
<div id="{{_id}}-before" tabindex="0" class="ui5-list-focusarea"></div>
{{/if}}

<ul id="{{_id}}-listUl"
class="ui5-list-ul"
Expand Down Expand Up @@ -46,5 +48,7 @@
</div>
{{/if}}

<div id="{{_id}}-after" tabindex="0" class="ui5-list-focusarea"></div>
{{#if hasData}}
<div id="{{_id}}-after" tabindex="0" class="ui5-list-focusarea"></div>
{{/if}}
</div>
6 changes: 5 additions & 1 deletion packages/main/src/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,12 @@ class List extends UI5Element {
return `${this._id}-header`;
}

get hasData() {
return this.items.length !== 0;
}

get showNoDataText() {
return this.items.length === 0 && this.noDataText;
return !this.hasData && this.noDataText;
}

get showBusy() {
Expand Down

0 comments on commit 5f8e0e2

Please sign in to comment.