Autodesk / Autodesk/hig

Button onClick handlers fail to function in Modal components

Open
#834 0 comments 0 reactions 0 assignees View on GitHub
bug community
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');
}} />

, document.getElementById('root')
);
```

### 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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.