When a subset widget is made empty focus is switched to the first
visible field. It should actually be set to the first visible and active
field, otherwise we can try to focus an un-selectable label.
While we're here, also properly set the visibility for the autoboot
enable/disable widget.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
widget_move(wl, y, screen->label_x);
wf = widget_select_base(screen->widgets.autoboot_f);
+ widget_set_visible(wf, true);
widget_move(wf, y, screen->field_x);
y += widget_height(wf);
struct nc_widget *widget;
size_t rem;
int i, val;
+ uint32_t opts;
/* Shift field focus to nearest active option or next visible field */
if (subset->n_active > 1) {
} else {
for (i = 0; i < set->n_fields; i++)
if (field_visible(set->fields[i])) {
- set->cur_field = set->fields[i];
- break;
+ opts = field_opts(set->fields[i]);
+ if ((opts & O_ACTIVE) == O_ACTIVE) {
+ set->cur_field = set->fields[i];
+ break;
+ }
}
}