Add input components 086-105; park focus off disabled controls

This commit is contained in:
ZacharyZhang-NY committed 2026-10-11 20:13:21 -04:00
1 parent 095eab2b4c
commit 03b789f533
34 files changed
+3058 -43

No files matched your search

+3 -3
View File
@@ -41,11 +41,11 @@ func RadioGroup(c *ui.Context, labels []string, selected *int, o RadioGroupOptio
shell, base, st := pixel.Shell(c, func() *ui.Element {
return ui.CheckboxBase(c, &on).Role(ui.RoleRadio).Label(l).Disabled(o.Disabled)
})
if base.FocusVisible() {
if base.Focused() {
focus = i
}
// Focus moved by arrows chooses; entering by Tab does not.
moved := focus == i && *last >= 0 && *last != i
// Arrow moves show focus and choose; Tab entry does not.
moved := base.FocusVisible() && *last >= 0 && *last != i
if !was && (base.Changed() || moved) {
*selected, res.Changed = i, true
}