Skip to content
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) #4280

Closed
wants to merge 1 commit into from

Conversation

tujoworker
Copy link
Member

@tujoworker tujoworker commented Nov 14, 2024

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:

<Field.String
  label="Label text"
  help={{
    title: 'Help is available',
    content:
      'Take the time to help other people without expecting a reward or gratitude is definitely important in living an optimistic life.',
    open: false,// only for the inline variant
    renderAs: 'dialog'
  }}
/>

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.

Copy link

vercel bot commented Nov 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
eufemia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 14, 2024 7:26pm

@tujoworker tujoworker force-pushed the feat/forms-inline-help-button branch 4 times, most recently from 91feb9e to acaa0d9 Compare November 14, 2024 14:56
Copy link

codesandbox-ci bot commented Nov 14, 2024

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.

@langz
Copy link
Contributor

langz commented Nov 14, 2024

trim.CD1E5E30-B40D-4CBF-8836-6DD8B22274B4.MOV

When closing, the title/header of the message jumps/shifts upwards a bit. Not very important, but it's noticeable.

Copy link
Contributor

@langz langz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good.
I've not read it all yet.

  • Have we added some docs/changelog presenting that the default behavior of the help text/property is now inline(previously a dialog).
  • And if some users still want to use the dialog variant, we could add what they need to do.
  • some docs about when we suggest using the dialog variant. You mentioned something in the lines of long texts, etc.
  • Is it only strings that can be provided to the help property? Or React.node's as well?

@langz
Copy link
Contributor

langz commented Nov 14, 2024

trim.CD1E5E30-B40D-4CBF-8836-6DD8B22274B4.MOV

When closing, the title/header of the message jumps/shifts upwards a bit. Not very important, but it's noticeable.

Also, when pressing the help button the input Field gets focus/active state/styling. Is that intentional and desired? Not sure myself.

@tujoworker tujoworker force-pushed the feat/forms-inline-help-button branch from 989ce7d to 1e06e8f Compare November 14, 2024 19:18
@tujoworker
Copy link
Member Author

the title/header of the message jumps/shifts upwards a bit

This is on purpose. But badly executed. Added a 40ms delay, and now I think it fells perfect.

@tujoworker
Copy link
Member Author

when pressing the help button the input Field gets focus/active state/styling. Is that intentional and desired?

This is a side effect. It's the "hover effect". First I have tried to have the HelpButton outside the label, but that creates other/larger layout/placement issues. I fear we have no choice. But I will take another look if there is way to avoid that.

@tujoworker tujoworker changed the title feat(Forms): introduce inline HelpButton to every Field.* component feat(Forms): add inline HelpButton to all Field.* components as default (with option to open in Dialog) Nov 14, 2024
@tujoworker
Copy link
Member Author

tujoworker commented Nov 14, 2024

Have we added some docs/changelog presenting that the default behavior of the help text/property is now inline(previously a dialog).

Not yet. I think we should add that in #4279

And if some users still want to use the dialog variant, we could add what they need to do.

<Field.String
  help={{
    title: 'Title',
    content: 'Content.',
+   renderAs: 'dialog'
  }}
/>

some docs about when we suggest using the dialog variant. You mentioned something in the lines of long texts, etc.
Is it only strings that can be provided to the help property? Or React.node's as well?

React.Node

@tujoworker tujoworker closed this Nov 14, 2024
@tujoworker
Copy link
Member Author

I'm not sure what happened here 🤷 and because it can't be repoened (why?) I create a new one #4282

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants