adobe / adobe/react-spectrum

Unexpected keyboard focus ring on SearchField, TextField components if they have height set

Open
#3,850 1 comment 0 reactions 0 assignees View on GitHub
bug SearchField TextField
Dominant language
TypeScript
Stars
15.9k
Forks
1.6k
Avg merge
3d 9m
Merged PRs (30d)
59

Description

# 🐛 Bug Report

If you set, say `minHeight`, on a `SearchField`, when `SearchField` is focused via keyboard it will include focusing the `div` in addition to the `input` element.

## 🤔 Expected Behavior

We expect to only see the focus ring on the `input` element itself.
Screen Shot 2022-12-14 at 1 37 04 PM

## 😯 Current Behavior

We are seeing two focus rings, one around `input` and one around the `div`.
Screen Shot 2022-12-14 at 1 37 52 PM

## 🔦 Context

We have some usages of the `SearchField` set with a `minHeight` in our product so when we keyboard `tab` into it, we noticed the double focus ring.

## 💻 Code Sample

https://codesandbox.io/s/loving-sea-vr2df2?file=/src/App.js

## 🌍 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| react-spectrum | 3.23.0 |
| Browser | Reproduced in Chrome, Firefox |
| Operating System | MacOS |

## 🧢 Your Company/Team

Adobe Administration UIs

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.