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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Added the option to modals to prevent closing on escape key press #12832

Conversation

borjajimnz
Copy link
Contributor

@borjajimnz borjajimnz commented May 16, 2024

Description

Added the option to modals prevent it from closing when the Escape key is pressed. This enhancement ensures the modal remains on the screen, offering a more consistent user experience and eliminating accidental closures when required.

Action::make('updateAuthor')
    ->form([
        // ...
    ])
    ->action(function (array $data): void {
        // ...
    })
    ->closedByHittingEscape(false)

Visual changes

No visual changes.

Functional changes

  • Code style has been fixed by running the composer cs command.
  • Changes have been tested to not break existing functionality.
  • Documentation is up-to-date.

Love Filament !! Good job 馃挄

@borjajimnz borjajimnz changed the title Added the option to prevent closing on escape key press Added the option to modals to prevent closing on escape key press May 16, 2024
@borjajimnz borjajimnz changed the title Added the option to modals to prevent closing on escape key press Feature: Added the option to modals to prevent closing on escape key press May 16, 2024
@danharrin danharrin added the enhancement New feature or request label May 17, 2024
@danharrin danharrin self-assigned this May 17, 2024
@danharrin danharrin added this to the v3 milestone May 17, 2024
Copy link
Member

@danharrin danharrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the terminology here to be closedByEscaping instead - "hitting" is a bit aggressive 馃ぃ

@zepfietje
Copy link
Member

Wouldn't closedByPressingEscape be clearer, @danharrin?

@danharrin
Copy link
Member

Considered it, but I prefer what I suggested

@borjajimnz
Copy link
Contributor Author

Changed @danharrin, regards!

@danharrin danharrin merged commit 082b4d2 into filamentphp:3.x May 20, 2024
10 checks passed
@danharrin
Copy link
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants