Skip to content

Conversation

@CharlieEtienne
Copy link
Contributor

Description

Tooltips are great on desktop to let users know why an action is disabled, but on mobile/touchscreens tooltips won't appear even on click.
A text besides could do the job but would take more space in UI.

This PR brings a new disabledNotification method usable on Actions, allowing to display a customizable Notification when the user clicks on a disabled action.

Action::make('I am a disabled button')
  ->disabled()
  ->disabledNotification(
      title: 'And that is why',
      icon: 'heroicon-o-exclamation-circle',
      color: 'danger',
      duration: '3000',
      body: 'Some more info',
  ),

Changes are implemented on buttons, links, icon buttons, badges, and dropdown action.

The notification will only show when the action is disabled.

Visual changes

Enregistrement.de.l.ecran.2026-01-15.a.16.08.39.mov

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.

@danharrin danharrin added the enhancement New feature or request label Jan 15, 2026
@danharrin danharrin added this to the v4 milestone Jan 15, 2026
@CharlieEtienne
Copy link
Contributor Author

Hey! It can certainly be improved, but I tried to follow the original code style, and update all the related files. If you are interested in this addition, I can add documentation.

@CharlieEtienne CharlieEtienne marked this pull request as ready for review January 15, 2026 20:29
@CharlieEtienne
Copy link
Contributor Author

The latest tests seem to fail when installing playwright, the test suite is passing locally

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: Todo

Development

Successfully merging this pull request may close these issues.

2 participants