Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using ipywidgets in jupyter notebook: how to set focus?

Is it possible to give a jupyter notebook widget the focus? I can't see documentation or hints in the code about this?

like image 707
Tim Richardson Avatar asked Jan 30 '26 04:01

Tim Richardson


2 Answers

I believe there is a pull request regarding this issue and in this commit you can actually see it in code. Since this PR is already merged I hope it will be out in the upcoming ipywidgets 8.0.

like image 55
alex Avatar answered Feb 01 '26 17:02

alex


It's available via .focus() but not to all widgets yet it seems.

See https://ipywidgets.readthedocs.io/en/latest/reference/ipywidgets.html#ipywidgets.widgets.domwidget.DOMWidget.focus

like image 21
grovina Avatar answered Feb 01 '26 19:02

grovina



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!