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

text_area entry containing unpaired opening (, [, { does not respect flex, vstack, or hstack widths #4615

Closed
ahgraber opened this issue Jan 10, 2025 · 2 comments

Comments

@ahgraber
Copy link

Describe the bug

I want to replicate the text editor, but I prefer to write in markdown / have the text persisted in State as markdown.
When using rx.text_area as a text entry field, if I type an opening (,[, or {, the text_area shrinks, which shifts everything in that flex, hstack, or vstack

To Reproduce

class State(rx.State):
    md: str = ""


def index() -> rx.Component:
    """Lay out main page."""
    return rx.flex(
            # editor edits text as HTML
            rx.text_area(
                set_contents=State.md,
                on_change=State.set_md,  
                width="50%",
            ),
            rx.box(
                rx.markdown(State.md),
                border="1px dashed #ccc",
                border_radius="4px",
                width="50%",
            ),

            direction="row",
            spacing="3",
        )

Expected behavior
text entered into the text_area should not alter how the page is rendered

Screenshots
image

Specifics (please complete the following information):

  • Python Version: 3.12
  • Reflex Version: 0.6.7
  • OS: macOS 15.2
  • Browser (Optional): Arc, Safari, Firefox

Additional context
Add any other context about the problem here.

@adhami3310
Copy link
Member

hey there, set_contents doesn't exist on text_area, so you're setting the CSS property (which doesn't exist) to State.md. When such value includes unclosed parenthesis, it basically causes a syntax issue and eats into the next CSS property, it would have worked if you had the width before the set_contents.

The larger issue is still true to some degree, we ideally should fail when you provide a syntactically incorrect value to a CSS property. This issue is in emotion-js/emotion though. Not sure if they're interested in fixing it.

@adhami3310 adhami3310 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants