Skip to content

Add isClearable option to Input components#177

Draft
Maschina wants to merge 1 commit intountitleduico:mainfrom
Maschina:feat/input-clearable
Draft

Add isClearable option to Input components#177
Maschina wants to merge 1 commit intountitleduico:mainfrom
Maschina:feat/input-clearable

Conversation

@Maschina
Copy link
Copy Markdown

@Maschina Maschina commented May 9, 2026

Description

When enabled for input components, an X button appears at the trailing edge while the input has a value (hidden via :placeholder-shown). The X button is an accessibility improvements that clears the input field's value. This is helpful especially for search fields.

CleanShot 2026-05-09 at 08 36 11@2x

When combined with a tooltip or invalid icon, the secondary icon shifts left to avoid overlap and snaps back when the input is empty.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Style/UI change (visual improvements, no functional changes)
  • Accessibility improvement
  • Refactoring (code changes that neither fix a bug nor add a feature)
  • Performance improvement
  • Chore (dependency updates, tooling changes, etc.)

Testing

Testing checklist

  • Functionality: Component works as expected
  • TypeScript: No TypeScript errors
  • Storybook: Stories render correctly
  • Accessibility:
    • Keyboard navigation works
    • Screen reader compatible
    • Focus management is correct
    • Color contrast meets WCAG AA standards
  • Responsive: Works on mobile, tablet, and desktop
  • Browser testing: Tested in multiple browsers
  • Performance: No performance regressions

Manual testing steps

Screenshots/Videos

CleanShot 2026-05-09 at 08 36 11@2x

Code quality checklist

  • Code style: Follows project conventions
  • ESLint: No linting errors
  • Prettier: Code is properly formatted
  • TypeScript: Full type coverage
  • Imports: Uses correct import paths (@/components/...)
  • Performance: No unnecessary re-renders or heavy computations
  • Error handling: Appropriate error boundaries and validation

📚 Documentation

  • Component props are documented with TypeScript interfaces
  • Storybook stories cover all variants
  • Usage examples are provided

Breaking changes

Migration guide

// Before
<OldComponent prop="value" />

// After
<NewComponent newProp="value" />

Additional context

When enabled, an X button appears at the trailing edge while the input
has a value (hidden via `:placeholder-shown`). When combined with a
tooltip or invalid icon, the secondary icon shifts left to avoid
overlap and snaps back when the input is empty.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Maschina Maschina changed the title Add isClearable option to Input boxes Add isClearable option to Input components May 9, 2026
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.

1 participant