textual
textual copied to clipboard
Should `TextArea` post `TextArea.Changed` message when calling the `load_text()` method?
I have an app that is tracking changes to a text area so it can update other widgets. If I change the content of the text area using the load_text()
method shouldn't a TextArea.Changed
message be posted. I understand not doing this during the init but I feel after the init, it may be a nice since the text area does actually change. It wouldn't be too hard to implement a catch that only posts the message if the text content is different from what is currently loaded.
I could do a PR if this is something you all feel warrants exploration, and if not, not a big deal as I found a simple work-a-round.
Keep up the great work. Cheers!
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
Perhaps related to the wider question of when messages should be posted in Textual:
- #3417
@TomJGooding, I did not see your issue when searching because I was being too specific in my search term. I agree with what @rodrigogiraoserrao said on your issue. Seems to me that if a widget has a Changed
message it should post anytime the widget changes. If that is not in-line with how the API plans to work, then I agree with you it should be noted clearly in the docs. Thanks!
Seems to have been fixed in https://github.com/Textualize/textual/pull/4256