Skip to content

Scroll in rx.text_area vanishes when auto_height is True #3863

Closed

Description

@VishDev12

Wonderful work with Reflex, it's truly a dream come true for many!

In the text_area component, if auto_height is set to True, the scroll bar vanishes. So in cases where the user limits the height of the text_area component, there's no way to navigate the text inside the text_area with a scroll bar.

I believe this line is the issue:

el.style.overflowY = "hidden";

Should this be set to scroll?

Activity

  1. changed the title [-]Scroll in rx.text_area[/-] [+]Scroll in rx.text_area vanishes when `auto_height` is True[/+] on Aug 31, 2024
  2. DanielFrantes commented on Sep 1, 2024

    @DanielFrantes
    Contributor

    I will take this.
    And do you have some testcase for this issue?
    It will be helpful for me to catch.
    thanks

  3. VishDev12 commented on Sep 1, 2024

    @VishDev12
    ContributorAuthor

    Hi! I'm not sure about a test case, but I do have this example:

    rx.text_area(
        placeholder="Enter text",
        id="message",
        width=["15em", "20em", "45em", "50em", "50em", "50em"],
        min_width="15em",
        max_width="70em",
        min_height="3em",
        max_height="15em",
        enter_key_submit=True,
        auto_height=True,
        ...
    )

    Now, when a lot of text is entered, it is not possible to scroll inside the text area.

  4. DanielFrantes commented on Sep 2, 2024

    @DanielFrantes
    Contributor

    Thank mate I needed something like this.

  5. DanielFrantes commented on Sep 4, 2024

    @DanielFrantes
    Contributor

    @VishDev12 Hello I tested it and so far it looks like this isnt a bug with nightly reflex, because If you write a lot of text to a text field it will extend to hold all text. So I think you can close It as non bug.

  6. VishDev12 commented on Sep 4, 2024

    @VishDev12
    ContributorAuthor

    Hey @danik292, thank you for exploring this! Sorry if this wasn't clear, but the issue is that when maximum height of the text_area is set, we expect the overflow text to be scrollable. But I'm guessing because of the following line, it is not scrollable and everything above max_height gets clipped; there is no scroll bar available inside the text_area:

    el.style.overflowY = "hidden";

  7. masenf commented on Sep 4, 2024

    @masenf
    Collaborator

    does it work as expected with that value set to "scroll"? if so then i believe that is the fix

  8. VishDev12 commented on Sep 4, 2024

    @VishDev12
    ContributorAuthor

    Yes it does, and thank you for the confirmation! I've submitted the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions