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

Revert breaking change in autocomplete prop of Taginput #414

Merged
merged 4 commits into from
Jan 18, 2025

Conversation

kikuomax
Copy link
Collaborator

@kikuomax kikuomax commented Jan 18, 2025

No relevant issue.

Proposed Changes

  • Removes the autocomplete prop from FormElementMixin
    • Reverts the change in the autocomplete prop type of Taginput, which was introduced at the commit 085bd85. The type becomes Boolean again.
    • Adds the autocomplete: String prop to each of the following components:
      • Autocomplete
      • Input
      • Numberinput
  • Replaces some spec snapshots which were updated due to the change in the attribute order of Input stubs

Background

While I was writing the changelog for v0.2.0, I found that the change in the autocomplete prop of Taginput was the only major breaking change introduced by the TypeScript migration.

I introduced the breaking change to Taginput at the commit 085bd85. The change was intended to resolve the discrepancy in the autocomplete prop between Taginput and FormElementMixin, which ended up with weird type errors. However, I should not have changed the autocomplete prop type of Taginput but should have removed the prop from FormElementMixin instead, because FormElementMixin itself did not use it but just defined it; it was there only to save the typing cost in host components which use FormElementMixin, and most of the host components did not even use the autocomplete prop.

Removes the `autocomplete` prop from `FormElementMixin`, and reverts the
breaking change that altered the `autocomplete` prop type of `Taginput`
from `Boolean` to `String`. The following components which mix
`FormElementMixin` in define their own `autocomplete` prop:
- `Autocomplete`
- `Input`
- `Numberinput`

Background: I introduced the breaking change to `Taginput` at the commit
085bd85. The change was intended to
resolve the discrepancy in the `autocomplete` prop between `Taginput`
and `FormElementMixin`, which ended up with weird type errors. I should
not have changed the `autocomplete` prop type of `Taginput` but should
have removed the prop from `FormElementMixin` instead, because
`FormElementMixin` itself did not use it but just defined it; it was
there only to save the typing cost in host components which use
`FormElementMixin`, and most of the host components do not even use the
`autocomplete` prop.
Updates `src/components/taginput/Taginput.spec.ts` because the
`autocomplete` prop type was changed: `Boolean` → `String`.
Some test snapshots have to be updated due to the change in the
attribute order of `Input`.
Changes the `autocomplete` prop type of `Taginput` from `String` to
`Boolean`.
@kikuomax kikuomax added this to the v0.2.0 milestone Jan 18, 2025
@kikuomax kikuomax requested a review from wesdevpro January 18, 2025 15:14
@kikuomax kikuomax changed the title Fix autocomplete prop discrepancy Revert breaking change in autocomplete prop of Taginput Jan 18, 2025
@wesdevpro wesdevpro merged commit 13fd2c3 into ntohq:dev Jan 18, 2025
18 checks passed
@kikuomax kikuomax deleted the fix-autocomplete-prop-discrepancy branch January 19, 2025 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants