Highlights
The widget checkbox now keeps keyboard focus after a mouse click in every browser, including Safari, so keyboard actions such as pressing Enter to submit the form work straight away. The native checkbox can now be themed with a new CSS variable.
New Features
--altcha-checkbox-native-accent-color
A CSS variable that sets the accent-color of the native checkbox (type="native"). It has no effect on the checkbox and switch types, which use --altcha-color-success.
- Default:
auto(the browser's default color)
altcha-widget {
--altcha-checkbox-native-accent-color: #7c3aed;
}To match the color of the checkbox and switch types:
altcha-widget {
--altcha-checkbox-native-accent-color: var(--altcha-color-success);
}Fixes
- The checkbox keeps focus after a mouse click (#206). Clicking the middle of the
checkboxor theswitchtoggle used to move focus to the page<body>. In Safari this happened for every type, includingnative. Focus now stays on the checkbox, so the next key press goes to the form.
Behavior Changes
- Safari: the
switchtype now shows its focus outline after a mouse click, the same as Chrome and Firefox already do. Thecheckboxtype shows its focus outline only when it is focused with the keyboard.
Upgrade Notes
- No changes are required. If you don't set the new variable, the native checkbox looks the same as before.