Skip to content

TextArea.placeholder renders incorrectly if it contains newline characters #6122

@darrenburns

Description

@darrenburns

I was trying to add a little bit of help text to a TextArea in Posting, as it's prime real estate for it :)

Example

from textual.app import App, ComposeResult
from textual.widgets import TextArea


class TextAreaPlaceholderMultipleLines(App[None]):
    def compose(self) -> ComposeResult:
        yield TextArea(placeholder="Line 1\nLine 2\nLine 3")


if __name__ == "__main__":
    app = TextAreaPlaceholderMultipleLines()
    app.run()

Result

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions