Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change so Widget.notify_change doesn't create comm
Browse files Browse the repository at this point in the history
fleming79 committed Mar 10, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 8f22131 commit ae6df72
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/ipywidgets/ipywidgets/widgets/widget.py
Original file line number Diff line number Diff line change
@@ -697,9 +697,10 @@ def notify_change(self, change):
# Send the state to the frontend before the user-registered callbacks
# are called.
name = change['name']
if self.comm is not None and getattr(self.comm, 'kernel', True) is not None:
comm = self._trait_values.get('comm')
if comm and getattr(comm, 'kernel', None):
# Make sure this isn't information that the front-end just sent us.
if name in self.keys and self._should_send_property(name, getattr(self, name)):
if name in self.keys and self._should_send_property(name, change['new']):
# Send new state to front-end
self.send_state(key=name)
super().notify_change(change)

0 comments on commit ae6df72

Please sign in to comment.