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

Should TextArea post TextArea.Changed message when calling the load_text() method? #3660

Closed
joshbduncan opened this issue Nov 9, 2023 · 5 comments

Comments

@joshbduncan
Copy link
Contributor

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!

@joshbduncan joshbduncan changed the title Should TextArea post TextArea.Changed message when calling the load_text()? Should TextArea post TextArea.Changed message when calling the load_text() method? Nov 9, 2023
Copy link

github-actions bot commented Nov 9, 2023

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

@TomJGooding
Copy link
Contributor

TomJGooding commented Nov 9, 2023

Perhaps related to the wider question of when messages should be posted in Textual:

@joshbduncan
Copy link
Contributor Author

@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!

@darrenburns
Copy link
Member

Seems to have been fixed in #4256

Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

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

3 participants