@@ -95,3 +95,54 @@ export const EscapeFromEditors: Story = {
9595 name : 'Popup - Escape handling' ,
9696 render : EscapeFromEditorsExample ,
9797} ;
98+
99+ const TabFocusLoopExample : Story [ 'render' ] = ( {
100+ tabFocusLoopEnabled,
101+ } ) => {
102+ const [ visible , setVisible ] = useState ( false ) ;
103+
104+ const show = useCallback ( ( ) => setVisible ( true ) , [ ] ) ;
105+ const hide = useCallback ( ( ) => setVisible ( false ) , [ ] ) ;
106+
107+ return (
108+ < div style = { { padding : 24 } } >
109+ < p style = { { marginBottom : 16 , color : '#555' } } >
110+ Toggle < strong > tabFocusLoopEnabled</ strong > in the Controls panel.
111+ When enabled, pressing Tab cycles focus only within the popup.
112+ When disabled, Tab can move focus outside the popup.
113+ </ p >
114+ < Button text = "Open Popup" type = "default" onClick = { show } />
115+
116+ < Popup
117+ visible = { visible }
118+ onHiding = { hide }
119+ title = "Tab Focus Loop Demo"
120+ width = { 420 }
121+ height = "auto"
122+ shading = { false }
123+ showCloseButton
124+ tabFocusLoopEnabled = { tabFocusLoopEnabled }
125+ >
126+ < div style = { { display : 'flex' , flexDirection : 'column' , gap : 12 , padding : '8px 0' } } >
127+ < TextBox label = "First Field" />
128+ < TextBox label = "Second Field" />
129+ < TextBox label = "Third Field" />
130+ </ div >
131+ </ Popup >
132+ </ div >
133+ ) ;
134+ } ;
135+
136+ export const TabFocusLoop : Story = {
137+ name : 'Popup - tabFocusLoopEnabled' ,
138+ args : {
139+ tabFocusLoopEnabled : true ,
140+ } ,
141+ argTypes : {
142+ tabFocusLoopEnabled : {
143+ control : 'boolean' ,
144+ description : 'Specifies whether focus loops within the popup when pressing Tab' ,
145+ } ,
146+ } ,
147+ render : TabFocusLoopExample ,
148+ } ;
0 commit comments