Skip to content

fix(components): keep AddressListField entry toggle flush to the input - #198

Merged
pasevin merged 1 commit into
mainfrom
fix/addresslistfield-toggle-flush
Jul 20, 2026
Merged

fix(components): keep AddressListField entry toggle flush to the input#198
pasevin merged 1 commit into
mainfrom
fix/addresslistfield-toggle-flush

Conversation

@pasevin

@pasevin pasevin commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the visual glitches in AddressListField's entry-mode toggle across single and bulk modes:

  • The toggle is now an attached tab pinned flush to the input/textarea bottom-right corner, inset from the rounded corner.
  • It no longer shifts when the resolution announcer (single) or bulk preview text appears — announcer/helper text renders on its own gapped row on the left.
  • It no longer overlaps the action button when the field is empty — the toggle row is in flow and reserves its own height.
  • The input/textarea is lifted above the toggle (z-10) so the focus ring is not covered by the overlapping tab.

API

  • AddressField gains announcerEndSlot?: React.ReactNode — trailing content pinned beside the resolution announcer row.
  • TextAreaField gains helperEndSlot?: React.ReactNode — trailing content pinned beside the helper-text row.

Both are additive and backward-compatible: when omitted, the components render exactly as before (standalone AddressField announcer behavior is unchanged when no resolver is mounted).

Test plan

  • pnpm --filter @openzeppelin/ui-components lint:fix
  • pnpm --filter @openzeppelin/ui-components test — 318 passing (added layout coverage in AddressField.announcerEndSlot.test.tsx and AddressListField.test.tsx)
  • pnpm --filter @openzeppelin/ui-components build
  • Verified in the example app (examples/basic-react-app → Forms → AddressListField):
    • single idle + resolved (vitalik.eth): toggle flush, announcer gapped, no shift
    • bulk empty: toggle flush, no overlap with "Add addresses"
    • bulk with invalid text: toggle stable, "1 invalid" preview on the left
    • focus ring not covered by the toggle

Changeset

patch on @openzeppelin/ui-components.

@pasevin
pasevin requested a review from a team as a code owner July 20, 2026 18:27
@netlify

netlify Bot commented Jul 20, 2026

Copy link
Copy Markdown

Deploy Preview for openzeppelin-ui ready!

Name Link
🔨 Latest commit 9491a7b
🔍 Latest deploy log https://app.netlify.com/projects/openzeppelin-ui/deploys/6a5e85e4f038ab0008ae5964
😎 Deploy Preview https://deploy-preview-198--openzeppelin-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

The single/bulk entry-mode toggle is now an attached tab pinned flush to the
input's bottom-right corner (inset from the rounded corner). It no longer
shifts when the resolution announcer or bulk preview text appears, and no
longer overlaps the action button when the field is empty.

- Add `announcerEndSlot` to `AddressField` and `helperEndSlot` to
  `TextAreaField` to pin trailing content beside the announcer/helper row
- Render the toggle and announcer/helper in one in-flow row that reserves
  height, cancelling the parent gap so the toggle sits flush
- Lift the input/textarea above the toggle (z-10) so the focus ring is not
  covered by the overlapping tab
- Cover the layout in AddressField/AddressListField/TextAreaField tests

Co-authored-by: Cursor <cursoragent@cursor.com>
@pasevin
pasevin force-pushed the fix/addresslistfield-toggle-flush branch from c113149 to 9491a7b Compare July 20, 2026 20:32
@pasevin pasevin changed the title fix(components): keep AddressListField toggle flush to input fix(components): keep AddressListField entry toggle flush to the input Jul 20, 2026
@pasevin
pasevin merged commit b9a7555 into main Jul 20, 2026
14 checks passed
@pasevin
pasevin deleted the fix/addresslistfield-toggle-flush branch July 20, 2026 21:33
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant