@@ -3,6 +3,7 @@ import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
3
3
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js" ;
4
4
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js" ;
5
5
import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js" ;
6
+ import query from "@ui5/webcomponents-base/dist/decorators/query.js" ;
6
7
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js" ;
7
8
import { isPhone } from "@ui5/webcomponents-base/dist/Device.js" ;
8
9
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js" ;
@@ -13,6 +14,7 @@ import type List from "@ui5/webcomponents/dist/List.js";
13
14
import type { ListItemClickEventDetail , ListSelectionChangeEventDetail } from "@ui5/webcomponents/dist/List.js" ;
14
15
import announce from "@ui5/webcomponents-base/dist/util/InvisibleMessage.js" ;
15
16
import InvisibleMessageMode from "@ui5/webcomponents-base/dist/types/InvisibleMessageMode.js" ;
17
+ import { renderFinished } from "@ui5/webcomponents-base/dist/Render.js" ;
16
18
17
19
import ViewSettingsDialogMode from "./types/ViewSettingsDialogMode.js" ;
18
20
import "@ui5/webcomponents-icons/dist/sort.js" ;
@@ -248,6 +250,9 @@ class ViewSettingsDialog extends UI5Element {
248
250
@slot ( )
249
251
filterItems ! : Array < FilterItem > ;
250
252
253
+ @query ( "[ui5-list]" )
254
+ _list ! : List ;
255
+
251
256
_dialog ?: Dialog ;
252
257
_sortOrder ?: List ;
253
258
_sortBy ?: List ;
@@ -265,6 +270,14 @@ class ViewSettingsDialog extends UI5Element {
265
270
}
266
271
}
267
272
273
+ onAfterRendering ( ) {
274
+ if ( this . isModeFilter ) {
275
+ renderFinished ( ) . then ( ( ) => {
276
+ this . _list ?. focusFirstItem ( ) ;
277
+ } ) ;
278
+ }
279
+ }
280
+
268
281
onInvalidation ( changeInfo : ChangeInfo ) {
269
282
if ( changeInfo . type === "slot" ) {
270
283
this . _confirmedSettings = this . _settings ;
@@ -506,7 +519,7 @@ class ViewSettingsDialog extends UI5Element {
506
519
}
507
520
508
521
afterDialogOpen ( ) : void {
509
- this . _dialog ?. querySelector < List > ( "[ui5-list]" ) ?. focusFirstItem ( ) ;
522
+ this . _list ?. focusFirstItem ( ) ;
510
523
511
524
this . _focusRecentlyUsedControl ( ) ;
512
525
0 commit comments