PullJosh / leopard-website

This repo contains the source code for the Leopard website
https://leopardjs.com
14 stars 3 forks source link

Birthday month input broken in some browsers #51

Closed PullJosh closed 3 months ago

PullJosh commented 3 months ago

https://scratch.mit.edu/discuss/topic/420162/?page=53#post-8037209

Potential bug? I can't register an account in brave browser, as the birthday month field resets everytime I click away from it. I can set a date just fine, but clicking anywhere (including the register button) clears it again. Also, the current format is “January 2000”, while below the box it says that the format should be “YYYY-MM”.

Using Firefox, the Format is correct, where it's YYYY-MM, but typing in 1998-04 for example, always deletes the “0” after clicking away, which makes me unable to register.

https://scratch.mit.edu/projects/1043871984/#comments-412442313

"if I register with my month "02" it automatically goes to "2" and doesn't accept it" [...] I'm using Firefox in macOS

towerofnix commented 3 months ago

I can reproduce this:

But not on Chrome 126 on macOS, where the prompt is completely different:

February 2024 in Birthday Month input, with February selection-highlighted

It clears as soon as I tab out of the input (or move focus in general, e.g. click Register):

Empty input showing a bunch of dashes, a space, and then four more dashes
towerofnix commented 3 months ago

Note Brave and many other browsers are based on Chromium, and would have the same strange prompt shown above.

PullJosh commented 3 months ago

Since <input type="month" /> support seems to be all over the place, I think it makes sense to replace this with a pair of dropdowns. One for the month and one for the year. Keep it simple.

PullJosh commented 3 months ago

Should be fixed by 03a0e87