pi-hole / web

Pi-hole Dashboard for stats and more
https://pi-hole.net
Other
2k stars 555 forks source link

Auto resize some textarea fields #2998

Closed DL6ER closed 5 months ago

DL6ER commented 5 months ago

What does this implement/fix?

Implements auto resizing for selected <textarea> input fields

[!NOTE] This feature is brand new and requires an up-to-date browser. To date, only Chrome 123.0+ supports this.

Examples: 0 1 many

regex

1 2 3

There is some protection installed to ensure fields can neither get too small...

Screenshot from 2024-04-01 19-54-44

... nor too large (scrolling is enabled in this case):

Screenshot from 2024-04-01 19-55-50


Related issue or feature (if applicable): https://discourse.pi-hole.net/t/autoresize-von-textarea-dhcp-hosts-form-control-static-dhcp-configuration/68855

Pull request in docs with documentation (if applicable): N/A


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

Checklist:

rdwebdesign commented 5 months ago

I'm not sure if we should limit the width using max-inline-size.

The current layout uses width: 100% for other form elements.

DL6ER commented 5 months ago

Where would we need ultra-wide textarea inputs? I have no objections against removing parts of the defensive CSS if they are breaking something. The rules are there to prevent odd results with extremely long inputs like you could have in dns.hosts for records IPv6 + very long hostnames, etc.

rdwebdesign commented 5 months ago

Where would we need ultra-wide textarea inputs?

That's not the issue, but we would have screen sizes where every form element will take 100% of its parent container, except these textarea elements, breaking the layout.

The rules are there to prevent odd results with extremely long inputs like you could have in dns.hosts for records IPv6 + very long hostnames, etc.

We currently have width: 100%. With this rule, form elements won't be wider than their containers. Long lines will simply break inside the textarea.