[material-ui][ButtonBase] Allow disabling the ripple when right-clicked (or other buttons) #44154
Labels
component: button
This is the name of the generic UI component, not the React module!
component: ButtonBase
The React component.
new feature
New feature or request
package: material-ui
Specific to @mui/material
waiting for 👍
Waiting for upvotes
Summary
In most cases, a Button doesn't really do something when it's clicked with middle or right buttons. However currently the ripple will still show when clicking a button with any button. I don't think this is really a good idea, since it will mislead the user.
My idea is to add a property similar to 'disableTouchRipple' to all components that have a ripple, but it allows the developer to control which mouse button will let the ripple will be displayed. For example,
And the default value of this property should be [0], which means only the main button (usually the left button) will trigger ripples. This property enables the developer to control it, cause sometimes one may listen to, for example, right-click events. In this scenario, this gives the full-control to adapt different using cases.
Examples
You can also define an enum for MouseButtons, or a string-union. In our projects we use an enum to represent mouse buttons like this, and you guys can use it as long as you like:
Motivation
This idea is really important for our projects. If this can be added, we'll be so happy and appreciated.
And when we have some income, we'll considering buying you guys a cup of coffee by donating.
Thanks for your work!
Search keywords: ripple, right, button, buttonbase, mouse, click
The text was updated successfully, but these errors were encountered: