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

Enhance xt.input attribute #122

Closed
anirudh-hegde opened this issue Jan 16, 2024 · 2 comments
Closed

Enhance xt.input attribute #122

anirudh-hegde opened this issue Jan 16, 2024 · 2 comments

Comments

@anirudh-hegde
Copy link

def index() -> xt.Component:
    layout = xt.form(xt.vstack(
        xt.input(
            placeholder="Paste YAML code here",
            on_change=State.on_yaml_input_change,
            width="30%",
            height="300px",
        ), ),
        xt.button("Convert to Python", on_click=State.handle_conversion),
        xt.text(State.python_data, font_size="2em"),
        spacing="1em",
        align_items="center",
        justify_content="center",
        height="100vh",
    )
    return layout

Problem statement

when I type inside the input it shows
image

Feature

When I press enter it should go to next line

@anubrag
Copy link
Collaborator

anubrag commented Jan 16, 2024

Hey Anirud,

For handling larger text inputs like YAML code, we can use xt.text_area a better fit. Here's a quick example to show how it can be set up:

xt.text_area(
    placeholder="Paste YAML code here",
    on_change=State.on_yaml_input_change,
    width="30%",
    height="300px",
)

By the way, I'm currently working on putting together more detailed documentation for these components, including text_area. It's a work in progress, but you can check out what I've got so far here. I'm planning to get the form-related docs polished up first.

@anirudh-hegde
Copy link
Author

Thank you, it's working :)

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