Skip to content

Conversation

snowystinger
Copy link
Member

Reverts #8895

Closes #5953

Need to fix autoFocus case as pointed out in previous PR

@rspbot
Copy link

rspbot commented Sep 23, 2025

if (!e.isTrusted && shouldUseVirtualFocus && inputRef.current && getActiveElement(getOwnerDocument(inputRef.current)) !== inputRef.current) {
inputRef.current.focus();
if (inputRef.current instanceof getOwnerWindow(inputRef.current).HTMLInputElement) {
inputRef.current.select();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right? I thought it only selected when you were tabbing, which FocusScope is simulating.

if (getActiveElement(ownerDocument) === lastFocusedElement && element.isConnected) {
focusWithoutScrolling(element);
if (element instanceof getOwnerWindow(element).HTMLInputElement) {
element.select();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to revert this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can input receive focus differently in a popover scenario
3 participants