@@ -3,6 +3,7 @@ import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
33import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js" ;
44import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js" ;
55import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js" ;
6+ import query from "@ui5/webcomponents-base/dist/decorators/query.js" ;
67import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js" ;
78import { isPhone } from "@ui5/webcomponents-base/dist/Device.js" ;
89import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js" ;
@@ -13,6 +14,7 @@ import type List from "@ui5/webcomponents/dist/List.js";
1314import type { ListItemClickEventDetail , ListSelectionChangeEventDetail } from "@ui5/webcomponents/dist/List.js" ;
1415import announce from "@ui5/webcomponents-base/dist/util/InvisibleMessage.js" ;
1516import InvisibleMessageMode from "@ui5/webcomponents-base/dist/types/InvisibleMessageMode.js" ;
17+ import { renderFinished } from "@ui5/webcomponents-base/dist/Render.js" ;
1618
1719import ViewSettingsDialogMode from "./types/ViewSettingsDialogMode.js" ;
1820import "@ui5/webcomponents-icons/dist/sort.js" ;
@@ -248,6 +250,9 @@ class ViewSettingsDialog extends UI5Element {
248250 @slot ( )
249251 filterItems ! : Array < FilterItem > ;
250252
253+ @query ( "[ui5-list]" )
254+ _list ! : List ;
255+
251256 _dialog ?: Dialog ;
252257 _sortOrder ?: List ;
253258 _sortBy ?: List ;
@@ -265,6 +270,14 @@ class ViewSettingsDialog extends UI5Element {
265270 }
266271 }
267272
273+ onAfterRendering ( ) {
274+ if ( this . isModeFilter ) {
275+ renderFinished ( ) . then ( ( ) => {
276+ this . _list ?. focusFirstItem ( ) ;
277+ } ) ;
278+ }
279+ }
280+
268281 onInvalidation ( changeInfo : ChangeInfo ) {
269282 if ( changeInfo . type === "slot" ) {
270283 this . _confirmedSettings = this . _settings ;
@@ -506,7 +519,7 @@ class ViewSettingsDialog extends UI5Element {
506519 }
507520
508521 afterDialogOpen ( ) : void {
509- this . _dialog ?. querySelector < List > ( "[ui5-list]" ) ?. focusFirstItem ( ) ;
522+ this . _list ?. focusFirstItem ( ) ;
510523
511524 this . _focusRecentlyUsedControl ( ) ;
512525
0 commit comments