Type "anything" in the email input.
Can type "anything" since maxLength is not enforced. Inspecting the input element shows a value of "anything" and the maxLength attribute is not there.
Can't type "anything" since maxLength is enforced. Inspecting the input does not show a value of "anything" and the maxLength attribute is equal "0".
Thanks for the report. I guess this is something to be added to the vnode normalization here: https://github.com/preactjs/preact/blob/master/compat/src/render.js#L142
Since this seems to be a beginner friendly issue I'll flag it as such and will wait a bit to see whether somebody wants to tackle it.
The codesandbox is using old versions of Preact, but it does look like we are failing to convert null to undefined here. This can be fixed in core.
Note that this only affects maxLength={null} - maxLength={undefined} works properly.
I updated the sandbox to use latest Preact version. This issue is not affecting our team at the moment since we got stuck a few months ago with other issues on our transition to use preact/compat but I might tackle it by end of week if not one jumps on it. Do we want this to be fix in core or compat? @developit
That would be cool! I guess core should be fine.
Sad to hear about the issues, are we talking about preact bugs/incompatibilities?