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

bug(input_text_area): Auto resized text areas resize on visibility change #1569

Merged
merged 11 commits into from
Jul 26, 2024

Conversation

schloerke
Copy link
Collaborator

From https://discord.com/channels/1109483223987277844/1265694689378697227/1266038169053171712

When the input text area would be displayed after an accordion expanded or a new tab was displayed, the text area would have height of 0 as the original scroll height was 0 (as it was hidden).

Now, if the scroll height is 0 an intersection observer is used until the text area is slightly on screen, then we update the height. To signal that we should perform this default behavior, a value of rows=0 is used. This is not a possible value, so .getAttribute("rows") must be used to check for the 0 value. (Otherwise, target.rows will return 2, the default value.)

@schloerke schloerke added the bug Something isn't working label Jul 25, 2024
@schloerke schloerke added this to the v1.1.0 milestone Jul 25, 2024
shiny/ui/_input_text.py Outdated Show resolved Hide resolved
shiny/ui/_input_text.py Outdated Show resolved Hide resolved
@schloerke schloerke marked this pull request as ready for review July 25, 2024 17:36
@schloerke schloerke requested a review from cpsievert July 25, 2024 17:36
@schloerke schloerke requested a review from cpsievert July 25, 2024 18:35
CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Carson Sievert <[email protected]>
@schloerke schloerke enabled auto-merge July 25, 2024 20:58
@schloerke schloerke added this pull request to the merge queue Jul 25, 2024
Copy link
Collaborator

@cpsievert cpsievert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 25, 2024
@schloerke schloerke enabled auto-merge July 25, 2024 21:23
@schloerke schloerke added this pull request to the merge queue Jul 25, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 25, 2024
@schloerke schloerke merged commit 97dd4a7 into main Jul 26, 2024
48 checks passed
@schloerke schloerke deleted the text_area_hidden_autoresize branch July 26, 2024 14:17
schloerke added a commit to machow/py-shiny that referenced this pull request Jul 26, 2024
* main:
  bug(input_text_area): Auto resized text areas resize on visibility change (posit-dev#1569)
  chore(ci): Skip all chat tests on webkit (posit-dev#1575)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants