[Accessibility] Manage focus on navigation (#39350)
This commit is contained in:
1 parent
bff9f0eb6d
commit
bcb8553e01
22 files changed
+265
-37
No files matched your search
@@ -26,6 +26,7 @@ export const AccountFieldActions: FC<{ id: string }> = ({ id }) => {
|
||||
openModal({
|
||||
modalType: 'ACCOUNT_EDIT_FIELD_EDIT',
|
||||
modalProps: { fieldKey: id },
|
||||
ignoreFocus: true,
|
||||
}),
|
||||
);
|
||||
}, [dispatch, id]);
|
||||
|
||||
@@ -137,16 +137,28 @@ export const AccountEdit: FC = () => {
|
||||
);
|
||||
|
||||
const handleOpenModal = useCallback(
|
||||
(type: ModalType, props?: Record<string, unknown>) => {
|
||||
dispatch(openModal({ modalType: type, modalProps: props ?? {} }));
|
||||
(
|
||||
type: ModalType,
|
||||
{
|
||||
modalProps = {},
|
||||
ignoreFocus = false,
|
||||
}: { modalProps?: Record<string, unknown>; ignoreFocus?: boolean } = {},
|
||||
) => {
|
||||
dispatch(
|
||||
openModal({
|
||||
modalType: type,
|
||||
modalProps,
|
||||
ignoreFocus,
|
||||
}),
|
||||
);
|
||||
},
|
||||
[dispatch],
|
||||
);
|
||||
const handleNameEdit = useCallback(() => {
|
||||
handleOpenModal('ACCOUNT_EDIT_NAME');
|
||||
handleOpenModal('ACCOUNT_EDIT_NAME', { ignoreFocus: true });
|
||||
}, [handleOpenModal]);
|
||||
const handleBioEdit = useCallback(() => {
|
||||
handleOpenModal('ACCOUNT_EDIT_BIO');
|
||||
handleOpenModal('ACCOUNT_EDIT_BIO', { ignoreFocus: true });
|
||||
}, [handleOpenModal]);
|
||||
const handleCustomFieldAdd = useCallback(() => {
|
||||
handleOpenModal('ACCOUNT_EDIT_FIELD_EDIT');
|
||||
|
||||
Reference in new issue
Block a user