Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hooks): add use-form hook and changes to related components #14

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

danielsimao
Copy link
Member

@danielsimao danielsimao commented Sep 20, 2023

Closes #12

📝 Description

  • Updated outdated testing packages
  • Add use-form hook
    1. add getTokenFieldProps: specific function for TokenInput that required some changes on that component
    2. changes to getSelectFieldProps: blur handler has moved in from getFieldProps
    3. props that were passed in previous mentioned function, now are defined in hook level using hideErrors prop.
    4. add tests
  • fix some type issues that were blocking the build
  • changes to TokenInput which are related to use-form (try here):
    1. added onValueChange: this event is not used to maintain use-form updated, instead of relying on manually trigger
    event
    2. improved aria: added aria-controls to balance MAX button which affects the input. When the input is affected by the button, the focus is set to the input. Why? Based on html native number input which has buttons that increment and decrement the input, when clicked, the focus is always set on the input. This is essencial because it allows external form apis do know that the input is being touched (this is achieved with onBlur event).

⛳️ Current behavior (updates)

  • TokenInput: when the max button is triggered, focus is not set on the input

🚀 New behavior

  • TokenInput: focus is set on the input when max btn is triggered.

@changeset-bot
Copy link

changeset-bot bot commented Sep 20, 2023

🦋 Changeset detected

Latest commit: 3c9ad30

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@interlay/ui Patch
@interlay/hooks Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Sep 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 21, 2023 10:16am

@danielsimao danielsimao marked this pull request as draft September 20, 2023 09:22
@danielsimao danielsimao changed the title feat: wip feat(components): improve TokenInput events and Input components types Sep 21, 2023
@danielsimao danielsimao changed the title feat(components): improve TokenInput events and Input components types feat(hooks): add use-form hook and changes to related components Sep 21, 2023
@danielsimao danielsimao linked an issue Sep 21, 2023 that may be closed by this pull request
@danielsimao danielsimao marked this pull request as ready for review September 21, 2023 10:05
Copy link
Contributor

@tomjeatt tomjeatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great

@danielsimao danielsimao merged commit 85d810a into main Sep 21, 2023
7 checks passed
@danielsimao danielsimao deleted the rui/use-form branch September 21, 2023 11:02
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.

Add useForm hook
2 participants