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

TextArea improvements #896

Closed
howudodat opened this issue Dec 4, 2023 · 0 comments
Closed

TextArea improvements #896

howudodat opened this issue Dec 4, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request version 2.x.x Version 2.x.x issues
Milestone

Comments

@howudodat
Copy link

howudodat commented Dec 4, 2023

Please consider or add the following improvements to TextArea:

  1. unset word wrap inherited from dui-field. In my opinion TextArea should wordwrap and scroll by default. The following css allows it to word wrap
textarea.dui-field-input {
	white-space: unset;
}

Alternatively a css class or helper function could be created: TextArea.wordwrap() { getInputElement().setCssProperty("white-space", "unset");

  1. Allow sizing of TextArea. Currently to size a TextArea, it needs to be sized by rows, or the following line needs commented out (I see no reason to even have setHeight("auto") so please consider removing it)
  private void adjustHeight() {
    // getInputElement().style().setHeight("auto");
    int scrollHeight = getInputElement().element().scrollHeight;
    if (scrollHeight < 30) {
      scrollHeight = 28;
    }
    if (autoSize) {
      getInputElement().style().setHeight(scrollHeight + "px");
    }
  }
  1. Allow sizing through TextArea.setSize()...It seems a bit unusual that to size the TextArea I need to call TextArea.getInputElement.setSize(). I understand why, but it's not intuitive

  2. Alternatively allow the TextArea to consume it's parent's height (dui_h_full). This too requires dui_h_full to be set on every layer and requires height:auto to be removed, a helper function here would be nice.

taBillingNotes.fixedSize();
taBillingNotes.addCss(dui_w_full, dui_h_full);
taBillingNotes.getBodyElement().addCss(dui_h_full);
taBillingNotes.getWrapperElement().addCss(dui_h_full);
taBillingNotes.getInputElement().addCss(dui_h_full); 
@vegegoku vegegoku self-assigned this Dec 6, 2023
@vegegoku vegegoku added enhancement New feature or request version 2.x.x Version 2.x.x issues labels Dec 6, 2023
@vegegoku vegegoku added this to the 2.0.0-RC5 milestone Dec 6, 2023
vegegoku added a commit that referenced this issue Dec 6, 2023
@vegegoku vegegoku closed this as completed Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request version 2.x.x Version 2.x.x issues
Projects
Status: Done
Development

No branches or pull requests

2 participants