mirror of
				https://github.com/Textualize/textual.git
				synced 2025-10-17 02:38:12 +03:00 
			
		
		
		
	blur action
This commit is contained in:
		| @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). | ||||
|  | ||||
| - Added `can_focus` and `can_focus_children` parameters to scrollable container types. https://github.com/Textualize/textual/pull/5226 | ||||
| - Added `textual.lazy.Reveal` https://github.com/Textualize/textual/pull/5226 | ||||
| - Added `Screen.action_blur` https://github.com/Textualize/textual/pull/5226 | ||||
|  | ||||
| ## [0.85.2] - 2024-11-02 | ||||
|  | ||||
|   | ||||
| @@ -452,7 +452,7 @@ class WidgetsScreen(PageScreen): | ||||
|     } | ||||
|     """ | ||||
|  | ||||
|     BINDINGS = [Binding("escape", "unfocus", "Unfocus any focused widget", show=False)] | ||||
|     BINDINGS = [Binding("escape", "blur", "Unfocus any focused widget", show=False)] | ||||
|  | ||||
|     def compose(self) -> ComposeResult: | ||||
|         with lazy.Reveal(containers.VerticalScroll(can_focus=False)): | ||||
| @@ -465,6 +465,3 @@ class WidgetsScreen(PageScreen): | ||||
|             yield Logs() | ||||
|             yield Sparklines() | ||||
|         yield Footer() | ||||
|  | ||||
|     def action_unfocus(self) -> None: | ||||
|         self.set_focus(None) | ||||
|   | ||||
| @@ -780,6 +780,10 @@ class Screen(Generic[ScreenResultType], Widget): | ||||
|         """Action to minimize the currently maximized widget.""" | ||||
|         self.minimize() | ||||
|  | ||||
|     def action_blur(self) -> None: | ||||
|         """Action to remove focus (if set).""" | ||||
|         self.set_focus(None) | ||||
|  | ||||
|     def _reset_focus( | ||||
|         self, widget: Widget, avoiding: list[Widget] | None = None | ||||
|     ) -> None: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Will McGugan
					Will McGugan