Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
17
rated 0 times [  22] [ 5]  / answers: 1 / hits: 30953  / 7 Years ago, tue, march 7, 2017, 12:00:00

According to React Material-UI docs, I have a prop hoveredStyle to work with: http://www.material-ui.com/#/components/icon-button



I want to use IconButton for two purposes:




  1. Utilize its tooltip prop for accessibility

  2. I can wrap Material-UI svg icons directly



However, I don't want the cursor to change to a pointer when I hover (which is default behavior I believe), so I changed it like so.



import DeleteIcon from 'material-ui/svg-icons/action/delete

const hoveredStyle = {
cursor: 'initial'
}

render() {
return (
<IconButton tooltip=Description here hoveredStyle={hoveredStyle}>
<DeleteIcon />
</IconButton>
)
}


This works fine, except that the split millisecond that I enter hover mode on the icon, I still see the default hand pointer before it gets set to the normal mouse pointer. How do I approach this?


More From » css

 Answers
3

I just tested adding a cursor: default to the style of both IconButton and DeleteIcon and it seems to have the functionality you want. (No pointer cursor on hover.)



const noPointer = {cursor: 'default'};
return (
<div>
<IconButton tooltip=Description here style={noPointer}>
<DeleteIcon style={noPointer} />
</IconButton>
</div>
);


proof


[#58635] Monday, March 6, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ryderalfonsos

Total Points: 655
Total Questions: 88
Total Answers: 91

Location: Nauru
Member since Thu, Feb 2, 2023
1 Year ago
ryderalfonsos questions
Mon, Sep 9, 19, 00:00, 5 Years ago
Wed, Feb 13, 19, 00:00, 5 Years ago
Tue, Feb 12, 19, 00:00, 5 Years ago
Fri, Dec 28, 18, 00:00, 6 Years ago
;