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

If i give large Text for header component in my form builder, UI is getting disrupted. There is no way to limit the length as header component does not p #1524

Closed
hidayathBR opened this issue Feb 22, 2024 · 2 comments · Fixed by #1526
Labels

Comments

@hidayathBR
Copy link

Description: If i give large Text for header component in my form builder, UI is getting disrupted. There is no way to limit the length as header component does not provide a prop to do it.

Environment Details:

  • formBuilder Version:
  • Browser:
  • OS:

Expected Behavior: i want to limit the length of the header component from the code.

Actual Behavior

Steps to Reproduce

Screenshot - (optional)

headdeerrr

@lucasnetau
Copy link
Collaborator

lucasnetau commented Feb 22, 2024

FormBuilder doesn't try to get in the way of valid inputs. To restrict the max length for labels you should either hook into the onAddField event and add a maxlen attribute to the input (if HTML labels are disabled), or you need to write a function that limits the number of characters into the div[contenteditable].

On the display side, Header elements already wrap by default in browsers, however in your instance you do not have any whitespace or punctuation for the browser to break on. this can be fixed with CSS, either hiding the overflow or allowing the header to break in the middle of a word.

    overflow: hidden; //or
    word-wrap: break-word;

It makes sense to add word-wrap: break-word to the formBuilder css

Copy link

github-actions bot commented Mar 1, 2024

🎉 This issue has been resolved in version 3.19.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants