@@ -16,6 +16,7 @@ import {
1616 isEnter ,
1717
1818} from "@ui5/webcomponents-base/dist/Keys.js" ;
19+ import { isPhone } from "@ui5/webcomponents-base/dist/Device.js" ;
1920import type { ITabbable } from "@ui5/webcomponents-base/dist/delegate/ItemNavigation.js" ;
2021import { getScopedVarName } from "@ui5/webcomponents-base/dist/CustomElementsScope.js" ;
2122import type { IFormInputElement } from "@ui5/webcomponents-base/dist/features/InputElementsFormSupport.js" ;
@@ -235,8 +236,6 @@ class MultiInput extends Input implements IFormInputElement {
235236 }
236237
237238 innerFocusIn ( ) {
238- this . tokenizer . _scrollToEndOnExpand = true ;
239- this . tokenizer . expanded = true ;
240239 this . focused = true ;
241240
242241 this . tokens . forEach ( token => {
@@ -369,20 +368,23 @@ class MultiInput extends Input implements IFormInputElement {
369368 if ( this . tokenizer ) {
370369 this . tokenizer . readonly = this . readonly ;
371370 }
372-
373- // Reset toggle state if there are tokens and dialog is about to open
374- if ( this . tokens . length > 0 && ! this . _userToggledShowTokens ) {
375- this . _showTokensInSuggestions = true ;
376- }
377371 }
378372
379373 /**
380- * Override the _handlePickerAfterOpen method to reset toggle state when dialog opens with tokens
374+ * Override the _handlePickerAfterOpen method to handle token display based on device type
381375 */
382376 _handlePickerAfterOpen ( ) {
383377 if ( this . tokens . length > 0 ) {
384- this . _showTokensInSuggestions = true ;
378+ // On mobile: show tokens by default (for filter dialog feature)
379+ // On desktop: keep showing suggestions (default behavior)
380+ if ( isPhone ( ) ) {
381+ this . _showTokensInSuggestions = true ;
382+ }
385383 this . _userToggledShowTokens = false ;
384+
385+ // Expand tokenizer to show all tokens and prevent cut-off
386+ this . tokenizer . _scrollToEndOnExpand = true ;
387+ this . tokenizer . expanded = true ;
386388 }
387389
388390 super . _handlePickerAfterOpen ( ) ;
@@ -469,20 +471,15 @@ class MultiInput extends Input implements IFormInputElement {
469471
470472 /**
471473 * Computes the effective state for showing tokens in suggestions.
472- * Defaults to true when tokens exist, but respects explicit user toggle .
474+ * Returns false (show suggestions) by default, true only when explicitly set .
473475 */
474476 get _effectiveShowTokensInSuggestions ( ) {
475- // If no tokens exist, always false
477+ // If no tokens exist, always show suggestions
476478 if ( this . tokens . length === 0 ) {
477479 return false ;
478480 }
479481
480- // If user has never interacted with the toggle, default to true when tokens exist
481- if ( ! this . _userToggledShowTokens ) {
482- return true ;
483- }
484-
485- // If user has interacted, respect their choice
482+ // Return the current state (will be true on mobile after picker opens, false otherwise)
486483 return this . _showTokensInSuggestions ;
487484 }
488485}
0 commit comments