-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat(Forms): add inline HelpButton to all Field.* components as default (with option to open in Dialog) #4282
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I tested tabbing with keyboard, and it works great 👍 It only happens when spacing/entering, not when clicking. The issue/error is that it somehow focuses the section(?)-element inside the help text, which I don't think it should? As it doesn't do so when clicking with the mouse. Screen.Recording.2024-11-15.at.09.21.06.mov |
|
||
<Examples.InlineHelpButtonVerticalLabelDescription /> | ||
|
||
### Inline help button (horizontal label) |
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.
### Inline help button (horizontal label) | |
### Inline help button (horizontal label) | |
Help text will appear above the field when using horizontal labels. |
Makes sense, but just got surprised when I tested this https://eufemia-git-feat-forms-inline-help-button-eufemia.vercel.app/uilib/extensions/forms/create-component/FieldBlock/demos/#inline-help-button-horizontal-label, as I sort of still expected it to show up the same as with vertical labels, but that's not possible 😅
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 gave it a try. And I think its better to have it appear always "below" the label. Also when the layout is horizontal.
I tested the following example with the following code:
And for the field with Screen.Recording.2024-11-15.at.10.10.12.mov |
I made a CSB to try out help together with Field.Selection input fields changes position and/or width when opening/closing the help: Screen.Recording.2024-11-15.at.11.44.04.movScreen.Recording.2024-11-15.at.11.44.55.movScreen.Recording.2024-11-15.at.11.44.34.movScreen.Recording.2024-11-15.at.11.44.44.movFurther, it's also not all Fields that support |
Should we add this |
The same happens with almost all feature fields Screen.Recording.2024-11-15.at.12.02.41.mov |
Here's a CSB displaying some possible alignment issues when using help with layout vertical for fields that have two fields., in a card It's like it takes a bit more width than the width of the input field. |
4c45f73
to
748cc60
Compare
748cc60
to
3501aa5
Compare
225e546
to
be09fcf
Compare
9f690f5
to
c27bc9b
Compare
c27bc9b
to
7045da1
Compare
7045da1
to
fc5061a
Compare
I think I have covered now all of your fantastic feedback. The rotation animation runs now also when hiding the help content. Some fields do not support a horizontal layout, such as PostcalCode and PhoneNumber. But also Composition does not support it. |
I have update the docs for the PostalCodeAndCity field. PhoneNumber is already taken care of.
I'm not able to reproduce it anymore. Also, we already have
Found another solution.
Also enhanced + added a visual test. |
Thanks for the updates @tujoworker
I've not tested them yet. EDIT: I've tested them now, and it looks better 👏 |
I quickly re-tested tabbing and openeing/closing with enter and space keys, and I feel it works worse now. Using space, first time it opens, next time I do space it scrolls down the page(even though the button looks active/focused). Using enter, first time it opens, next time I press enter it won't close (even though the button looks active/focused): Screen.Recording.2024-11-16.at.12.46.25.movMaybe we just revert this funcionality, and fix it if it becomes a issue down the line, I'm not sure if the issue initially reported is critical or not. |
Since last time I checked the CSBs, the All fields horizontal latest commit looks quite different from what it did in the previous commit/change. How it was: How it is now: |
Do we have to support it in the future? Here's a CSB using Field.Provider with layout horizontal. Sidenote: Not sure why, but in that CSB I'm not able to enter anything in the postalcode field 🤔 |
1e5c72d
to
24ab19b
Compare
We set focus on the section so screen readers can navigate in there and also get read out the text. Even if the content is placed on a different DOM order.
Yes. Not it is aligned on how the status messages looks. Same border radius too. I think this is the most logical way to display this information on in a consistent way.
I have never seen any PhoneNumber etc. layout that could work with these fields. So as of now, this is how it is. Most horizontal layouts are used within a small part of the form. So we do not need to support necessarily all fields with that layout. |
Thanks Tobias, that sounds smart. |
Thanks again the updates @tujoworker 🚀 |
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.
Thanks for the great job 👏
Works perfect now :)
24ab19b
to
fb9b030
Compare
fb9b030
to
c421c4e
Compare
## [10.56.0](v10.55.1...v10.56.0) (2024-11-18) ### 🐛 Bug Fixes * **DatePicker:** ensure that `endMonth` does not fallback to `startMonth` when `endMonth` prop is defined ([#4254](#4254)) ([5281257](5281257)) * **Forms:** render given elements to `warning` and `info` properties ([#4261](#4261)) ([d60de25](d60de25)) ### ⚡ Refactoring * **DatePicker:** convert properties to camel case and deprecate those with snake case ([#4273](#4273)) ([a69a8aa](a69a8aa)) ### ✨ Features * **Field.Date:** add DatePickerProps ([#4160](#4160)) ([6a3765b](6a3765b)) * **Forms:** add `asyncFileHandler` to Field.Upload to support async file handling during upload ([#4281](#4281)) ([030a09c](030a09c)) * **Forms:** add inline HelpButton to all Field.* components as default (with option to open in Dialog) ([#4282](#4282)) ([e869a60](e869a60)) * **Forms:** add support for multiple info, warning and error messages given by an array ([#4284](#4284)) ([78f2fe8](78f2fe8)) * **ListFormat:** adds spacing properties ([#4255](#4255)) ([c72d999](c72d999)) * **Paragraph:** handle nested paragraphs (to be `span`'s) ([#4251](#4251)) ([ca3bbde](ca3bbde))
🎉 This PR is included in version 10.56.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR changes the existing behavior of the
help
prop for Fields that previously supported it. The content now opens inline instead of in a Dialog.The
help
prop has now all of these optional props:We use this prop description:
Examples with inline "HelpButton":
NB: We do not document the internals of the inline version at this time. This can be included in another PR. The reason is that it would require additional tests, examples, and documentation. It is also an "isolated" feature specific to the HelpButton. However, as of this writing, I am unsure if we will ever document it, as integration is not straightforward. There are several considerations to address when implementing it.