Textualize / textual

The lean application framework for Python. Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal and a web browser.
https://textual.textualize.io/
MIT License
25.19k stars 772 forks source link

Textualize v0.80.0 Textarea tries to set cursor position before its mounted and throws error textual._context.NoActiveAppError #5042

Closed paulrobello closed 1 week ago

paulrobello commented 1 week ago

Textual Diagnostics

Versions

Name Value
Textual 0.80.0
Rich 13.8.1

Python

Name Value
Version 3.11.9
Implementation CPython
Compiler MSC v.1938 64 bit (AMD64)
Executable E:\Repos\parllama.venv\Scripts\python.exe

Operating System

Name Value
System Windows
Release 10
Version 10.0.22631

Terminal

Name Value
Terminal Application Windows Terminal
TERM xterm-256color
COLORTERM Not set
FORCE_COLOR Not set
NO_COLOR Not set

Rich Console options

Name Value
size width=138, height=39
legacy_windows False
min_width 1
max_width 138
is_terminal True
encoding utf-8
max_height 39
justify None
overflow None
no_wrap False
highlight None
markup None
height None

The TextArea is created in a widgets init then mounted in its compose

self._text_area = TextArea(
    id="user_input_textarea",
)

Throws Error: textual._context.NoActiveAppError

  File ".\.venv\Lib\site-packages\textual\widgets\_text_area.py", line 631, in _watch_selection
    self.app.cursor_position = self.cursor_screen_offset
github-actions[bot] commented 1 week ago

We found the following entries in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

github-actions[bot] commented 1 week ago

Don't forget to star the repository!

Follow @textualizeio for Textual updates.