mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 21:49:37 -04:00
Autosize textboxes w/out highlighting placeholders
Scrolling within textareas on the page is a bit grim. Which is why we don’t do it for the textboxes that people use to edit templates. This commit will allow us to extend the auto-resizing of `<textarea>`s to those which don’t need the highlighting of placeholders. The code is still quite coupled to the placeholder highlighting code, because both work by copying the content of the `<textarea>` into a `<div>` that underlaps the textbox. This `<div>` is used for both rendering the placeholder highlights, and calculating the natural height of the content. So it would be hard/confusing to split the two bits of code into separate modules.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
hint=False,
|
||||
highlight_tags=False,
|
||||
autofocus=False,
|
||||
autosize=False,
|
||||
colour_preview=False,
|
||||
help_link=None,
|
||||
help_link_text=None,
|
||||
@@ -47,7 +48,8 @@
|
||||
%}
|
||||
{{ field(
|
||||
class=field_class,
|
||||
data_module='highlight-tags' if highlight_tags else '',
|
||||
data_module='highlight-tags' if highlight_tags or autosize else '',
|
||||
data_highlight_placeholders='true' if highlight_tags else 'false',
|
||||
rows=rows|string,
|
||||
**kwargs
|
||||
) }}
|
||||
|
||||
Reference in New Issue
Block a user