Preact: [Material-UI] Select onChange broken - modifying event target

Created on 22 Oct 2019  路  4Comments  路  Source: preactjs/preact

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?

Most helpful comment

Patched in 4.5.2 of material-ui:

https://github.com/mui-org/material-ui/pull/18027

All 4 comments

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.

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

Patched in 4.5.2 of material-ui:

https://github.com/mui-org/material-ui/pull/18027

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paulkatich picture paulkatich  路  3Comments

k15a picture k15a  路  3Comments

mizchi picture mizchi  路  3Comments

nopantsmonkey picture nopantsmonkey  路  3Comments

youngwind picture youngwind  路  3Comments