This commit is contained in:
Darren Burns
2024-12-17 11:45:57 +00:00
parent 82d0ac5fff
commit 83f92f926a

View File

@@ -41,7 +41,7 @@ For instance, the following would return a `Button` instance (assuming there is
my_button = self.query_one(Button) my_button = self.query_one(Button)
``` ```
`query_one` searches *below* the widget it is called on, so if you call `query_one` on a widget, it will only find widgets that are descendants of that widget. `query_one` searches the DOM *below* the widget it is called on, so if you call `query_one` on a widget, it will only find widgets that are descendants of that widget.
If you wish to search the entire DOM, you should call `query_one` on the `App` or `Screen` instance. If you wish to search the entire DOM, you should call `query_one` on the `App` or `Screen` instance.