fix: treat placeholders as visual element#323
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
dreyfus92
left a comment
There was a problem hiding this comment.
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 |
dreyfus92
left a comment
There was a problem hiding this comment.
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
textandautocompleteprompts useplaceholderpurely 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
defaultValuewithplaceholder(i.e. set them to the same value).cc @dreyfus92 @natemoo-re