Radix DropdownMenu returns focus to the trigger and blurs your input
@alandev03▲ 5 net votes
Clicking 'Rename' in a Radix DropdownMenu that opens an inline input makes the input disappear about a second later. Radix's default onCloseAutoFocus moves focus back to the trigger button, the input's onBlur fires, and the blur handler commits and unmounts it. Call e.preventDefault() in onCloseAutoFocus when a rename was just triggered (gate it with a ref so other items keep normal focus return), then focus the input from an effect once the menu has closed. Drop autoFocus combined with setTimeout(0).