(core) Fix focus bug in filter menu

Summary:
It was impossible to focus the search input in the filter menu if either
of the range filter inputs were focused.

Test Plan: Browser test.

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D3942
pull/563/head
George Gevoian 11 months ago
parent d5fe26f63c
commit 271a5735c3

@ -470,9 +470,13 @@ function numericInput(obs: Observable<number|undefined|IRelativeDateSpec>,
editMode = false;
inputEl.value = formatValue(obs.get());
// Make sure focus is trapped on input during calendar view, so that uses can still use keyboard
// to navigate relative date options just after picking a date on the calendar.
setTimeout(() => opts.isSelected.get() && inputEl.focus());
setTimeout(() => {
// Make sure focus is trapped on input during calendar view, so that uses can still use keyboard
// to navigate relative date options just after picking a date on the calendar.
if (opts.viewTypeObs.get() === 'calendarView' && opts.isSelected.get()) {
inputEl.focus();
}
});
};
const onInput = debounce(() => {
if (isRelativeBound(obs.get())) { return; }

Loading…
Cancel
Save