diff --git a/ipympl/backend_nbagg.py b/ipympl/backend_nbagg.py index 1c955cb2..aa1882d8 100644 --- a/ipympl/backend_nbagg.py +++ b/ipympl/backend_nbagg.py @@ -181,7 +181,10 @@ def _handle_message(self, object, content, buffers): def send_json(self, content): # Change in the widget state? if content['type'] == 'cursor': - self._cursor = cursors_str[content['cursor']] + cursor = content['cursor'] + self._cursor = ( + cursors_str[cursor] if cursor in cursors_str else cursor + ) elif content['type'] == 'message': self._message = content['message']