microsoft / fast

The adaptive interface system for modern web experiences.
https://www.fast.design
Other
9.23k stars 590 forks source link

fix: browser validation for inputs doesn't work in safari and firefox #6915

Closed thomas-kumo closed 3 months ago

thomas-kumo commented 6 months ago

๐Ÿ› Bug Report

Browser validation is working in chrome but not in safari or firefox. Whenever you submit with a required field but no value in a form in chrome, you get a message from the browser telling your the field is required like the following:

Capture dโ€™eฬcran, le 2024-02-26 aฬ€ 12 41 56

However, we are not getting the same bahavior in safari and firefox.

๐Ÿ’ป Repro or Code Sample

https://jsfiddle.net/thomasleclerckumo/s92vtLc3/9/

๐Ÿค” Expected Behavior

I would expect the same behavior as chrome but in safari and firefox too. A proper validation message appearing.

๐Ÿ˜ฏ Current Behavior

Currently, these are the inputs that has a problem displaying the browser validation message when they have required as an attribute (this is what i've tested so far, maybe more to check) :

Currently, when we try to submit, this is the error we are getting in safari:

Capture dโ€™eฬcran, le 2024-02-26 aฬ€ 12 38 17

An invalid form control with name='select' is not focusable.

This is the result I would expect:

Capture dโ€™eฬcran, le 2024-02-26 aฬ€ 12 48 52

๐Ÿ’ Possible Solution

I don't know the exact nature of the problem so it's hard for me to come up with a solution but if I find anything, I'll make sure to update the thread here on this issue.

Maybe in house validation from FAST.

๐Ÿ”ฆ Context

If you need more context, I'll be more than happy to disclose them with you.

๐Ÿ”ฆ EXTRA QUESTIONS

๐ŸŒ Your Environment

"@microsoft/fast-element": "^1.12.0", "@microsoft/fast-foundation": "^2.49.2", "@microsoft/fast-react-wrapper": "^0.3.18", "@microsoft/fast-web-utilities": "^6.0.0",

janechu commented 3 months ago

Unfortunately @microsoft/fast-foundation is being deprecated, refer to #6955.