-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Improve text input handling #495
base: master
Are you sure you want to change the base?
Conversation
211bf1e
to
048630c
Compare
We'll keep putting the last value in the placeholder so that the user can keep track to what value is currently used. We can keep the values in the inputs when the user submits the form, and set the new placeholder. |
The value of the text input is already indicates the last set collection. What happen when the input is empty? It's also a valid collection value meaning the default one. |
The value does not match the current collection if the user changes the input, which is why the placeholder must be the last selected collection. If the user empties the form, the placeholder will be the default collection ID. Here: Bonjourr/src/scripts/features/backgrounds/unsplash.ts Lines 23 to 28 in f3bcb88
|
When the input is not empty, the placeholder is not displayed. Why does it need to be set to the latest one? When the input is empty, I know it will be set to the default one. But the default is an array, which one should it be? Or we need to show only a meanful name to the user as I said above, just "Bonjourr" ? |
The input can be emptied by the user before submitting the form. If the user forgets what the current value is, it can be a problem!
I guess for now the default collection can be |
I don't think so. That input is mostly used to change the collection. If he wants to keep it, he can simply don't submit the form, or ctrl+z, or refresh the page... You're right about the usage of the placeholder. But according to the MDN link, we shouldn't use it for displaying the current collection. |
048630c
to
7a2ed0e
Compare
7a2ed0e
to
6e03ee9
Compare
The placeholder is a way to make sure we know at all times what the current collection is. I don't want a user to refresh the page because he forgot what the collection was... Also MDN is warning against using the placeholder as a label, but any valid value the user submit is a good placeholder ☝️🤓 |
Otherwise your PR looks good to me ! |
6e03ee9
to
0127212
Compare
Fix #494