Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor disappears when using safari on Macos. #3

Closed
wtbsw opened this issue Feb 21, 2019 · 9 comments
Closed

Cursor disappears when using safari on Macos. #3

wtbsw opened this issue Feb 21, 2019 · 9 comments
Labels
bug Something isn't working Safari

Comments

@wtbsw
Copy link

wtbsw commented Feb 21, 2019

I have used this extension on mac. When this extension enabled, the cursor can't display in edit mode only on safari, both ok on chrome and Firefox.

default

default

Thank you for your helping.
@nesat
Copy link

nesat commented Mar 12, 2019

I have the same problem

@krassowski
Copy link
Owner

Thank you both @wtbsw and @nesat for reporting the problem and narrowing it to Safari on MacOS - this is really helpful!

May I ask you to provide the output (e.g. as a screen-shot) from the developer console of Safari, with the add-on enabled and after an attempt to "jump"?

This screencast: https://youtu.be/hIwrl8kCv04 demonstrates how to open the JavaScript error console in the developer tools of Safari (the interesting part is about one minute long, from beginning to 1:15).

PS. apologies for the delay, I've been busy with my Master thesis (but will be back to open source contributions this Friday).

@nesat
Copy link

nesat commented Mar 12, 2019

I mentioned in #6 that "go to the definition" does not work but I was mistaken. It works while using the keyboard only.

I checked the console error as you wish, it outputs:

TypeError: event.getModifierState is not a function. (In 'event.getModifierState(CodeMirrorExtension.modifierKey)', 'event.getModifierState' is undefined)

Screen Shot 2019-03-12 at 16 58 31

Here is the gif:
obufa-y51uz

@krassowski
Copy link
Owner

Thank you - this helps a lot! A final question, which version of Safari do you use?

The support table shows that getModifierState is supported by Safari 10.1+ (released two years ago).

@nesat
Copy link

nesat commented Mar 12, 2019

Safari version 12.0.3
MacOS Mojave 10.14.3

Thank you for maintaining the repo, it would be great to use your extension 👍

@krassowski krassowski added bug Something isn't working Safari labels Mar 12, 2019
@krassowski
Copy link
Owner

Ok, I found the culprit. Safari does implement getModifierState for keyboard events, but not for mouse events. I will need to write a polyfill manually checking metaKey, ctrlKey, altKey etc.

To highlight the line which needs to be changed:

if (button === 0 && event.getModifierState(CodeMirrorExtension.modifierKey as string)) {

I should have enough time this weekend to prepare a fix. Again, thanks for sending the details.

@krassowski
Copy link
Owner

Hi there! I've just published a new version which attempts to address the issue that you discovered. Could you re-install the extension (ensuring that you get 0.1.5 version) and let me know if the problem got resolved?

@nesat
Copy link

nesat commented Mar 17, 2019

I uninstalled the old version and then installed the new one. New version was installed without any error output but it was disabled initially and I can not enable it. I even tried to disable all my other extensions but still I am not able to enable the new version.

Although I could not find out the problem of my existing environment, sharing the extensions may help:

  • @jupyterlab/celltags v0.1.4
  • @jupyterlab/toc v0.6.0
  • @krassowski/jupyterlab_go_to_definition v0.1.5
  • @lckr/jupyterlab_variableinspector v0.1.0

Later I tried to create a fresh virtual environment and it works on the new virtual environment. I also tested the cursor and "go to the definition" action, they both work.

@krassowski
Copy link
Owner

Thank you! I will be closing this issue for now.

I have no ideas why the update did not work for you, though if you spot any suspected output in the developer console, please feel free to let me know opening a new issue - I will try to investigate then.

PS. I've just published v0.1.6 version, adding support to %store magic - you may try to see if updating with this one works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Safari
Projects
None yet
Development

No branches or pull requests

3 participants