Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Material-UI] Select onChange broken - modifying event target #2031

Closed
c-dante opened this issue Oct 22, 2019 · 4 comments
Closed

[Material-UI] Select onChange broken - modifying event target #2031

c-dante opened this issue Oct 22, 2019 · 4 comments

Comments

@c-dante
Copy link

c-dante commented Oct 22, 2019

Looks like the material-ui/core/Select modifies the target on a native event.

Seems they're also doing it on item click: https://github.com/mui-org/material-ui/blob/cdc4b98b62b43d4e7253f731f2028e45d669acf5/packages/material-ui/src/Select/SelectInput.js#L129

Browsers throw an error since the event is marked read-only.

I noticed there is some work to use non-synthetic events in preact-compat -- is there a way to configure it in certain cases?

@marvinhagemeister
Copy link
Member

FYI: There are currently no plans for synthetic events in Preact or preact/compat.

This issue is in particular a tough situation. I'm obviously biased, but imo it's a bug in material-ui. For me it's a big no no to mess with the event. If one wants to pass a custom value around, one can do so with a second parameter to the components callback function.

@c-dante
Copy link
Author

c-dante commented Oct 23, 2019

Definitely inclined to agree. And I'm absolutely not suggesting preact adds synthetic events.

I can open a ticket over with them -- either as a compat idea or otherwise.

Don't know if this is a bug that should live here or not -- but if the goal is for compat to have coverage this is a sticking point...

@c-dante
Copy link
Author

c-dante commented Oct 24, 2019

Following up, I made the issue over here: mui/material-ui#18006

Update: Here's the demo https://codesandbox.io/s/preact-material-ui-select-broken-eles6?fontsize=14

@c-dante
Copy link
Author

c-dante commented Oct 29, 2019

Patched in 4.5.2 of material-ui:

mui/material-ui#18027

@c-dante c-dante closed this as completed Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants