Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react tooltip on disabled button

/* Wrap the button in a span or div and conditionally set pointer-events to none */
<Tooltip title="You don't have permission to do this">
  <span>
    <button disabled={disabled} style={disabled ? { pointerEvents: "none" } : {}}>
      {'A disabled button'}
    </button>
  </span>
</Tooltip>
Source by material-ui.com #
 
PREVIOUS NEXT
Tagged: #react #tooltip #disabled #button
ADD COMMENT
Topic
Name
7+9 =