click-ui
click-ui copied to clipboard
Fix Inputs interactive area
Why
Horizontal space in Inputs appear interactive, and should be interactive, but is not. Clicking anywhere within visible input area should activate the field.
https://github.com/user-attachments/assets/6033411d-1252-45dd-adaa-0360fc8e2c93
What
To address the issue:
- Changed Inputs layout
-
TextField: introduced propsstartContentandendContent, that accept anyReactNodeand render extra content before or after input control -
SearchField: removed all code and remade the component on top ofTextField, because they are exactly the same; SearchField now usesstartContentto render its icon -
PasswordField: used the same utility component to render the eye button asTextFielduses to renderendContent - Changed how icons/buttons placed inside Inputs behave:
- before: hidden icons still occupy space
- after: hidden icons are not rendered at all
- why: hidden icons obscure interaction with the field in the same way; clicking any empty space should activate the field, but with hidden icons it's not the case
Also:
- Updated stories for
TextField,SearchField, andPasswordFieldto be auto-generated; now they are more informative and up-to-date with the actual components API.- before: https://click-ui.vercel.app/?path=/docs/forms-input-textfield--docs
- after: https://click-ui-git-textfield-active-area-clickhouse.vercel.app/?path=/docs/forms-input-textfield--docs
Remaining issues
- Because of how Inputs are built, there is still non-interactive areas in some cases. In particular, because we use
gapto create space between elements inside InputWrapper, these gaps don't have proper cursor, and aren't interactive. To be fixed in next iterations.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| click-ui | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 16, 2025 8:01pm |
mind accepted visual changes: https://www.chromatic.com/build?appId=6481a2f37ea081d3131e5219&number=3001