Skip to content

Commit 42a359a

Browse files
marker-daomarker dao ®
andauthored
Popup: Revert updating of old nested Angular component with tabFocusLoopEnabled, add story (#33016)
Co-authored-by: marker dao ® <youdontknow@marker-dao.eth>
1 parent 0d16fa9 commit 42a359a

9 files changed

Lines changed: 52 additions & 19 deletions

File tree

apps/react-storybook/stories/popup/Popup.stories.tsx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
};

packages/devextreme-angular/src/ui/nested/base/popup-options.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,6 @@ export abstract class DxoPopupOptions extends NestedOption {
302302
this._setOption('showTitle', value);
303303
}
304304

305-
get tabFocusLoopEnabled(): boolean {
306-
return this._getOption('tabFocusLoopEnabled');
307-
}
308-
set tabFocusLoopEnabled(value: boolean) {
309-
this._setOption('tabFocusLoopEnabled', value);
310-
}
311-
312305
get tabIndex(): number {
313306
return this._getOption('tabIndex');
314307
}

packages/devextreme-angular/src/ui/nested/drop-down-options.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ import {
8181
'shadingColor',
8282
'showCloseButton',
8383
'showTitle',
84-
'tabFocusLoopEnabled',
8584
'tabIndex',
8685
'title',
8786
'titleTemplate',

packages/devextreme-angular/src/ui/nested/filter-builder-popup.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ import {
8181
'shadingColor',
8282
'showCloseButton',
8383
'showTitle',
84-
'tabFocusLoopEnabled',
8584
'tabIndex',
8685
'title',
8786
'titleTemplate',

packages/devextreme-angular/src/ui/nested/popup.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ import {
8181
'shadingColor',
8282
'showCloseButton',
8383
'showTitle',
84-
'tabFocusLoopEnabled',
8584
'tabIndex',
8685
'title',
8786
'titleTemplate',

packages/devextreme-angular/src/ui/popover/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,7 @@ export class DxPopoverComponent extends DxComponent implements OnDestroy, OnChan
400400
}
401401

402402

403-
/**
404-
* [descr:dxPopupOptions.tabFocusLoopEnabled]
405403

406-
*/
407404
@Input()
408405
get tabFocusLoopEnabled(): boolean {
409406
return this._getOption('tabFocusLoopEnabled');

packages/devextreme-angular/src/ui/popup/component.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,10 +474,7 @@ export class DxPopupComponent extends DxComponent implements OnDestroy, OnChange
474474
}
475475

476476

477-
/**
478-
* [descr:dxPopupOptions.tabFocusLoopEnabled]
479477

480-
*/
481478
@Input()
482479
get tabFocusLoopEnabled(): boolean {
483480
return this._getOption('tabFocusLoopEnabled');

packages/devextreme-angular/src/ui/tooltip/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,7 @@ export class DxTooltipComponent extends DxComponent implements OnDestroy {
343343
}
344344

345345

346-
/**
347-
* [descr:dxPopupOptions.tabFocusLoopEnabled]
348346

349-
*/
350347
@Input()
351348
get tabFocusLoopEnabled(): boolean {
352349
return this._getOption('tabFocusLoopEnabled');

packages/devextreme-metadata/make-angular-metadata.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Ng.makeMetadata({
5959
removeMembers(/\/drop_down_editor\/ui.drop_down_editor:FieldAddons/),
6060
removeMembers(/\/load_panel:dxLoadPanelOptions.indicatorOptions/),
6161
removeMembers(/\/grids:LoadPanel.indicatorOptions/),
62+
removeMembers(/\/popup:dxPopupOptions.tabFocusLoopEnabled/),
6263
removeMembers(/\/scheduler:Toolbar/),
6364
removeMembers(/\/scheduler:dxSchedulerOptions\.editing\.form/),
6465
removeMembers(/\/scheduler:dxSchedulerOptions\.editing\.popup/),

0 commit comments

Comments
 (0)