Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align naming modals #62788

Merged
merged 3 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/dataviews/src/item-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ export function ActionModal< Item extends AnyItem >( {
title={ action.modalHeader || label }
__experimentalHideHeader={ !! action.hideModalHeader }
onRequestClose={ closeModal ?? ( () => {} ) }
focusOnMount="firstContentElement"
size="small"
overlayClassName={ `dataviews-action-modal dataviews-action-modal__${ kebabCase(
action.id
) }` }
Expand Down
7 changes: 6 additions & 1 deletion packages/edit-site/src/components/add-new-page/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ export default function AddNewPageModal( { onSave, onClose } ) {
}

return (
<Modal title={ __( 'Draft a new page' ) } onRequestClose={ onClose }>
<Modal
title={ __( 'Draft a new page' ) }
onRequestClose={ onClose }
focusOnMount="firstContentElement"
size="small"
>
<form onSubmit={ createPage }>
<VStack spacing={ 3 }>
<TextControl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ function RenameModal( { category, onClose } ) {
existingCategories={ existingCategories }
onClose={ onClose }
overlayClassName="edit-site-list__rename-modal"
focusOnMount="firstContentElement"
size="small"
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ export default function RenameModal( { menuTitle, onClose, onSave } ) {
titleHasChanged && notEmptyString( editedMenuTitle );

return (
<Modal title={ __( 'Rename' ) } onRequestClose={ onClose }>
<Modal
title={ __( 'Rename' ) }
onRequestClose={ onClose }
focusOnMount="firstContentElement"
size="small"
>
<form className="sidebar-navigation__rename-modal-form">
<VStack spacing="3">
<TextControl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export default function CreateTemplatePartModal( {
title={ modalTitle || defaultModalTitle }
onRequestClose={ restProps.closeModal }
overlayClassName="editor-create-template-part-modal"
focusOnMount="firstContentElement"
size="medium"
>
<CreateTemplatePartModalContents { ...restProps } />
</Modal>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
.editor-create-template-part-modal {
z-index: z-index(".editor-create-template-part-modal");

.components-modal__frame {
@include break-small {
max-width: 500px;
}
}
}

.editor-create-template-part-modal__area-radio-group {
Expand Down
2 changes: 2 additions & 0 deletions packages/editor/src/components/post-actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ function ActionWithModal( { action, item, ActionTrigger, onClose } ) {
overlayClassName={ `editor-action-modal editor-action-modal__${ kebabCase(
action.id
) }` }
focusOnMount="firstContentElement"
size="small"
>
<RenderModal
items={ [ item ] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ export default function CreateNewTemplateModal( { onClose } ) {
<Modal
title={ __( 'Create custom template' ) }
onRequestClose={ cancel }
focusOnMount="firstContentElement"
size="small"
>
<form
className="editor-post-template__create-form"
Expand Down
2 changes: 2 additions & 0 deletions packages/patterns/src/components/create-pattern-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export default function CreatePatternModal( {
title={ modalTitle || defaultModalTitle }
onRequestClose={ restProps.onClose }
overlayClassName={ className }
focusOnMount="firstContentElement"
size="small"
>
<CreatePatternModalContents { ...restProps } />
</Modal>
Expand Down
8 changes: 7 additions & 1 deletion packages/patterns/src/components/rename-pattern-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ export default function RenamePatternModal( {
};

return (
<Modal title={ __( 'Rename' ) } { ...props } onRequestClose={ onClose }>
<Modal
title={ __( 'Rename' ) }
{ ...props }
onRequestClose={ onClose }
focusOnMount="firstContentElement"
size="small"
>
<form onSubmit={ onRename }>
<VStack spacing="5">
<TextControl
Expand Down
Loading