Stop dark text fields from looking pre-selected when they auto-focus. #117

Merged
an.di merged 1 commits from adilallo/fix/TextInputFocusHighlight into main 2026-11-23 21:33:06 +00:00
Member

Overview

Opening Login focuses the email field so you can type right away. Chrome and Safari then paint a native inner bevel on that dark box, and TextInput treated any non-click focus as Tab — so the empty field looked highlighted before anyone typed.

This keeps auto-focus (you can still type immediately) but leaves the field looking at rest. The keyboard ring only shows when you actually Tab to it. The same native-chrome reset applies to every text field and textarea, not just login.

Changes

  • TextInput and SelectInput draw the keyboard focus ring only for :focus-visible (Tab). Programmatic focus from a modal stays visually default.
  • TextInput and TextArea use appearance-none so Safari/Chrome do not add an inner bevel.
  • Global base styles on text inputs and textareas: dark color-scheme, no OS chrome, and a dark autofill wash instead of the yellow one.
  • Tests for programmatic focus (no ring), Tab (:focus-visible ring), pointer focus (active border), and TextArea appearance-none.

How to Test

  1. npm run dev → open / → click Log in.
  2. Confirm the email field is focused (caret / typing works) but does not look selected or beveled. Placeholder you@example.com should sit on a flat gray fill.
  3. Tab to the field from the close button: the keyboard ring should appear. Click the field: active border, no keyboard ring.
  4. Check another form (e.g. Workshops signup email / organization name) for the same inner-bevel on focus.
  5. Optional: autofill an email and confirm there is no yellow wash.
  6. npx vitest run tests/components/TextInput.test.tsx tests/components/TextArea.test.tsx tests/components/SelectInput.test.tsx

Safari and Chrome on macOS are the browsers that showed this.

Notes

  • Staging still has the old look until this ships.
  • The login dialog’s overflow: hidden can clip the 4px Tab ring; that was already true and is not part of this change.
## Overview Opening Login focuses the email field so you can type right away. Chrome and Safari then paint a native inner bevel on that dark box, and TextInput treated any non-click focus as Tab — so the empty field looked highlighted before anyone typed. This keeps auto-focus (you can still type immediately) but leaves the field looking at rest. The keyboard ring only shows when you actually Tab to it. The same native-chrome reset applies to every text field and textarea, not just login. ## Changes - TextInput and SelectInput draw the keyboard focus ring only for `:focus-visible` (Tab). Programmatic focus from a modal stays visually default. - TextInput and TextArea use `appearance-none` so Safari/Chrome do not add an inner bevel. - Global base styles on text inputs and textareas: dark `color-scheme`, no OS chrome, and a dark autofill wash instead of the yellow one. - Tests for programmatic focus (no ring), Tab (`:focus-visible` ring), pointer focus (active border), and TextArea `appearance-none`. ## How to Test 1. `npm run dev` → open `/` → click **Log in**. 2. Confirm the email field is focused (caret / typing works) but does **not** look selected or beveled. Placeholder `you@example.com` should sit on a flat gray fill. 3. Tab to the field from the close button: the keyboard ring should appear. Click the field: active border, no keyboard ring. 4. Check another form (e.g. Workshops signup email / organization name) for the same inner-bevel on focus. 5. Optional: autofill an email and confirm there is no yellow wash. 6. `npx vitest run tests/components/TextInput.test.tsx tests/components/TextArea.test.tsx tests/components/SelectInput.test.tsx` Safari and Chrome on macOS are the browsers that showed this. ## Notes - Staging still has the old look until this ships. - The login dialog’s `overflow: hidden` can clip the 4px Tab ring; that was already true and is not part of this change.
an.di added 1 commit 2026-11-23 21:32:53 +00:00
an.di self-assigned this 2026-11-23 21:32:57 +00:00
an.di merged commit 6903cec32b into main 2026-11-23 21:33:06 +00:00
an.di deleted branch adilallo/fix/TextInputFocusHighlight 2026-11-23 21:33:06 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: CommunityRule/community-rule#117