polish/holdem-seats-one-size
Typing 0.25 into the small blind produced 250, and nothing said so. The six setup fields are wired `input` -> save -> Render.renderAll(), and renderAll comes back round through renderSetupFields and assigns `.value` to the very box being typed in. The decimal point is where that turns from a wasted render into a wrong number: a type="number" reports a half-typed "0." as "0", so the write-back erased the point, and assigning `.value` to a number input parks the caret at position 0, so every digit after it landed at the front. Measured keystroke by keystroke in Chrome: small blind "0.25" 0 -> 0 -> 20 -> 250 a table playing 250/500 big blind "0.50" 0 -> 0 -> 50 -> 500 start stack "12.50" 1 -> 12 -> 12 -> 512 -> 5012 rake percent "2.5" 2 -> 2 -> 52 a 52% rake rake cap "7.50" 7 -> 7 -> 57 -> 507 base pot "0.75" 0 -> 0 -> 70 -> 750 Every one of those is a valid number, so no validation could have caught it, and every pot for the rest of the night is computed off it. Two rules, kept separate. Render.setField refuses to write into the control that has focus — a render says what the state is, and is not entitled to say what somebody is half-way through typing. And the fields come off type="number", which is what made a half-typed number unreadable to begin with; it also drops characters silently, hides selectionStart, and puts a spin button in a 54px box where five digits already need 45 of the 52. That is the control GOV.UK dropped from their number patterns after user testing. inputmode is what summons the keypad on a phone, and "decimal" carries the separator a dealer needs to type 0.25 at all. With type="text" a stray letter now reaches the handler instead of being eaten, so Money.readAmount reads the boxes: empty is null, non-finite is null, and NaN never becomes a blind. A field skipped while focused catches up when it is stepped out of. After, on the same six: 0.25, 0.50, 12.50, 2.5, 7.50, 0.75 — and the panel glance reads "10 seats - $0.25/$0.50". 1385 tests pass (23 new, 19 of which fail against the code they replace). Sweep clean across 428 audits on 13 viewports; contrast unchanged. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb
Description
No description provided
142 MiB
Languages
JavaScript
68.4%
CSS
14.1%
C#
8%
HTML
4.5%
C++
4.4%
Other
0.5%