-
Notifications
You must be signed in to change notification settings - Fork 130
fix: treat placeholders as visual element #323
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
Conversation
🦋 Changeset detectedLatest commit: 8e567c9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
@example/basic • @example/changesets
commit: |
This changes how we deal with placeholders. Currently, a placeholder behaves as a visual hint of what we want the user to type. It also behaves as an optional default value, in that you can press `<Enter>` or `<Tab>` to insert it as the value. This is confusing since it means it is a "partial" default value, and a placeholder at the same time. This change basically removes the placeholder logic from core, such that the `text` and `autocomplete` prompts use `placeholder` purely as a render/visual hint. This updated behaviour means we render the placeholder when no value is set, but it can no longer be inserted as a value. To achieve that, you should combine `defaultValue` with `placeholder` (i.e. set them to the same value).
c52b13d
to
802a24e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea, but i don't know if it aligns with nate 😁
the original idea seemed to be that but we can achieve this with if you set i think this makes more sense than whats in main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that the changeset wasn't detected by the bot 😅
This aligns with what I'm expecting and was used to in 0.x. Additionally, this seem like the cleaner way for me. Strongly approve. |
This changes how we deal with placeholders.
Currently, a placeholder behaves as a visual hint of what we want the user to type. It also behaves as an optional default value, in that you can press
<Enter>
or<Tab>
to insert it as the value.This is confusing since it means it is a "partial" default value, and a placeholder at the same time.
This change basically removes the placeholder logic from core, such that the
text
andautocomplete
prompts useplaceholder
purely as a render/visual hint.This updated behaviour means we render the placeholder when no value is set, but it can no longer be inserted as a value. To achieve that, you should combine
defaultValue
withplaceholder
(i.e. set them to the same value).cc @dreyfus92 @natemoo-re