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
RFC: Visible internal label for NcInputField
s within the element
#4126
Comments
This looks good too! What might be problematic is the height of the element. For my suggestions we can use the standard height of 44px like buttons or the ℹ️ Edit: |
Also cc @nextcloud/designers |
@szaimen the advantage of the original proposal is that it doesn't interfere with the keyboard navigation though. Screen.Recording.2023-06-23.at.13.56.36.mov |
I found this video from Material design: l13ubrf0-Label.text_3P.mp4from here: https://m3.material.io/components/text-fields/guidelines So both versions are fine by me :) |
Design wise both look good to me as well, I would assume that animating the break in the border may be slightly tricky to get right. So I would vote for the original proposal with one change: reduce the padding of the field when it is focused. Right now there is just a tad bit more space to the left than in the top or bottom. In the screenshot, the text should start from the blue line, currently it starts from the red line. Another point to consider here is how this would work with icons, as many times the text field has a label with an icon or a placeholder text with an icon, so both of those should reduce size evenly. |
I've been testing this a bit and I have to take back what I said before about the focus outlines: it's impossible for this element to be focus and active at the same time. |
To allow testing this kind of component I have created a PR for it: #4287 |
This looks good! Some small alignment adjustments, with before/after screenshots:
The end results with those changes look like this. What do you think? Besides that, it looks good! Also, I am concerned about accessibility, specifically the hover and focus states when the field is filled. Maybe @Pytal or @JuliaKirschenheuter can take a look to see if everything is ok? :) |
I agree 200ms look better but yes we can go with I implemented most of your suggestions, looks better :)
For me this only works when setting the font size to 12px. Which I do not know is that good, looks a bit small? |
I experimented again, and I am ok with using 13px, especially since 12px is not used much elsewhere AFAIK. Updated comment :) However, |
Given this, I would also suggest to use the version with the label on the border so everything can be spaced out properly and we don't have problems with leading icons. |
@susnux I mean a leading icon such as in search |
🎉🎉🎉🎉🎉 |
I pretty sure this is nothing new, probably someone already uses something like this, but I wanted to know your opinions on this idea:
Having a visual label is most often required, but also often the placeholder is misused for it.
As placeholders should specify what input is correct or expected but not necessarily what field it currently is.
I also noticed that our
NcSelect
does now has a height of 48px vs all other input elements (36px), sometimes this looks odd together so I resize inputs to match the 48px. Which gives 12px extra space.Combining this two things I came up with the idea to have the label be inside the element and only shrink and move when entering text.
So this is how it could look like (just the "Old", "Good new" and "Disabled" ignore the other ones):
The text was updated successfully, but these errors were encountered: