Button onClick handlers fail to function in Modal components
- Dominant language
- JavaScript
- Stars
- 193
- Forks
- 112
- PR merge metrics
- No merged PRs in 30d
Description
### Issue: `onClick` event handlers within `buttons` on ` ` item do not get triggered
- Example from the [react playground](https://github.com/Autodesk/hig/blob/development/packages/react/src/playground/sections/ModalSection.js#L29) - not that this `onClick` is never triggered.
- Additional example:
```javascript
import ReactDOM from 'react-dom';
import * as hig from 'hig-react';
ReactDOM.render(
{ console.log('in gutter - this is not triggered'); } }
]}>
{
console.log('in body - this is triggered');
}} />
);
```
### Result:
- The `onClick` handler is not triggered
- In the react-playground example the modal sheet is not closed
- In the above code example, `in gutter - this is not triggered` is not output to the console
### Expected result:
- Opposite of above
Contributor guide
Research direction
Reproduce the issue using packages/react/src/playground/sections/ModalSection.js and the provided hig-react example. Compare the working body Button handler with the buttons prop path and trace how Modal renders those buttons. Done means the gutter button invokes its onClick handler and the playground modal closes as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100