Skip to content

Commit

Permalink
update overflowY in AUTO_HEIGHT_JS from hidden to scroll (#3882)
Browse files Browse the repository at this point in the history
  • Loading branch information
VishDev12 authored and adhami3310 committed Sep 9, 2024
1 parent e36fe8b commit 5712f10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion reflex/components/el/elements/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ class Select(BaseHTML):
const autoHeightOnInput = (e, is_enabled) => {
if (is_enabled) {
const el = e.target;
el.style.overflowY = "hidden";
el.style.overflowY = "scroll";
el.style.height = "auto";
el.style.height = (e.target.scrollHeight) + "px";
if (el.form && !el.form.data_resize_on_reset) {
Expand Down
2 changes: 1 addition & 1 deletion reflex/components/el/elements/forms.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,7 @@ class Select(BaseHTML):
"""
...

AUTO_HEIGHT_JS = '\nconst autoHeightOnInput = (e, is_enabled) => {\n if (is_enabled) {\n const el = e.target;\n el.style.overflowY = "hidden";\n el.style.height = "auto";\n el.style.height = (e.target.scrollHeight) + "px";\n if (el.form && !el.form.data_resize_on_reset) {\n el.form.addEventListener("reset", () => window.setTimeout(() => autoHeightOnInput(e, is_enabled), 0))\n el.form.data_resize_on_reset = true;\n }\n }\n}\n'
AUTO_HEIGHT_JS = '\nconst autoHeightOnInput = (e, is_enabled) => {\n if (is_enabled) {\n const el = e.target;\n el.style.overflowY = "scroll";\n el.style.height = "auto";\n el.style.height = (e.target.scrollHeight) + "px";\n if (el.form && !el.form.data_resize_on_reset) {\n el.form.addEventListener("reset", () => window.setTimeout(() => autoHeightOnInput(e, is_enabled), 0))\n el.form.data_resize_on_reset = true;\n }\n }\n}\n'
ENTER_KEY_SUBMIT_JS = "\nconst enterKeySubmitOnKeyDown = (e, is_enabled) => {\n if (is_enabled && e.which === 13 && !e.shiftKey) {\n e.preventDefault();\n if (!e.repeat) {\n if (e.target.form) {\n e.target.form.requestSubmit();\n }\n }\n }\n}\n"

class Textarea(BaseHTML):
Expand Down

0 comments on commit 5712f10

Please sign in to comment.