-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
const onSubmit: React.FormEventHandler<HTMLFormElement> = React.useCallback(
(e) => {
e.preventDefault();
if (value.length > 0) {
onAddItems([value]);
setValue("");
textRef.current?.focus();
// HACK: keep the bottom of the list in view.
// scrollIntoView doesn't seem to work well for this on mobile.
// Is there a better way?
if (keepInView) setTimeout(() => window.scrollBy(0, 52), 1);
}
},
[onAddItems, value, keepInView]
);onAddItems might not add anything if the item already exists, but we still scroll down.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working