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

Allow to disable a modal trigger #15582

Merged
merged 5 commits into from
Feb 13, 2025
Merged

Conversation

CharlieEtienne
Copy link
Contributor

Description

Currently there is no way to prevent a modal from being triggered. Even if the trigger button is disabled, the modal would still open, as in this example:

<x-filament::modal id="modalTest">
    <x-slot name="trigger">
        <x-filament::button :disabled="true">I'm disabled</x-filament::button>
    </x-slot>
    Hello, I'm a modal
</x-filament::modal>

This PR lets users disable the trigger element like this:

<x-filament::modal id="modalTest">
    <x-slot name="trigger" :disabled="true">
        <x-filament::button :disabled="true">I'm disabled</x-filament::button>
    </x-slot>
    Hello, I'm a modal
</x-filament::modal>

It also adds documentation for this change.

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.

@CharlieEtienne CharlieEtienne changed the title Patch 1 Allow to disable a modal trigger Feb 11, 2025
@danharrin danharrin added the bug Something isn't working label Feb 13, 2025
@danharrin danharrin added this to the v3 milestone Feb 13, 2025
@danharrin danharrin merged commit 114cf2d into filamentphp:3.x Feb 13, 2025
@danharrin
Copy link
Member

Thanks

@CharlieEtienne CharlieEtienne deleted the patch-1 branch February 13, 2025 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants