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

Clicking an active terminal in some versions of chrome switches terminal #330

Closed
itszn opened this issue Aug 31, 2017 · 17 comments
Closed

Comments

@itszn
Copy link

itszn commented Aug 31, 2017

Expected behavior

I would assume that clicking an active terminal would have no effect, since it already focused, based on To swich between terminals you can just click on terminal that you want to activate.

Actual behavior

Focus switches to another nearby terminal if present. If this is intended behavior, it does not happen in firefox. Also if it is intended, can we have some way to disable it?

Steps to reproduce

Visit https://codepen.io/anon/pen/brOQOv in chrome on Windows and click on the active terminal.

Browser and OS

Chrome 60 on Windows 8.
Doesn't seem to happen on ubuntu 16, or in firefox.

@jcubic
Copy link
Owner

jcubic commented Aug 31, 2017

Doesn't happen on Windows7 in VirtualBox will try to install win8. Does this happen on Linux/Chrome?

@itszn
Copy link
Author

itszn commented Aug 31, 2017

I have had it happen on chrome 60 on win8, chrome 60 on win10, but not on chromium or chrome 60 on linux. My friend also had it happen on safari on his iphone (ios 10.3).
Edit: Also chrome 60 for android

@jcubic
Copy link
Owner

jcubic commented Aug 31, 2017

I've just tested it in Chrome 60 on windows 10 and it work fine. I can click on same terminal and it stay focused. And I got the same behavior in Firefox.

Maybe you have some kind of extension installed in chrome, that modify the behavior.

@jcubic
Copy link
Owner

jcubic commented Aug 31, 2017

And just to be sure I have the same in Edge.

@jcubic
Copy link
Owner

jcubic commented Aug 31, 2017

Found another issue. When you created multiple terminals that where enabled all of them had cursor. Fixed that in devel branch, don't know if that's related. On codepen you will not see this because iframe is not in focus and you need to click on it first.

@jcubic
Copy link
Owner

jcubic commented Aug 31, 2017

The other idea is to add white border to terminal so you can see on which terminal you've clicked. Are you sure you click on the same terminal and not below the cursor.

@itszn
Copy link
Author

itszn commented Aug 31, 2017

So I actually tried it on my other win10 box, but it wasn't happening, so I'm still very unsure what could be causing it. I disabled all extensions, and recorded this in incognito mode:

@jcubic
Copy link
Owner

jcubic commented Sep 1, 2017

I think I've found the issue, one more thing can you copy/paste this snippet into console and tell me the output it should be false:

    (function() {
        return 'ontouchstart' in window || !!window.DocumentTouch &&
            document instanceof window.DocumentTouch;
    })();

The fix is only for case when this return true, so if this return false I'll need to find another issue with the code.

@jcubic
Copy link
Owner

jcubic commented Sep 1, 2017

Potential fix is in devel branch.

@itszn
Copy link
Author

itszn commented Sep 1, 2017

That returns true for the affected platforms I could get to right now.

@jcubic
Copy link
Owner

jcubic commented Sep 1, 2017

what about this one?

    (function() {
        return (('ontouchstart' in window)
                || (navigator.MaxTouchPoints > 0)
                || (navigator.msMaxTouchPoints > 0));
    })();

@itszn
Copy link
Author

itszn commented Sep 1, 2017

True on my chrome win8, chrome on android, and safari on iphone (all I can test right now)

@jcubic
Copy link
Owner

jcubic commented Sep 1, 2017

Weird for Chrome on windows, but the issue should be resolved anyway on devel branch can you test it? Here is your demo but with devel branch https://codepen.io/jcubic/pen/KvJMJx

@itszn
Copy link
Author

itszn commented Sep 1, 2017

The change fixes jumping to a different terminal. It now unfocuses the terminal on the second click.
Edit: To clarify, no terminals are focused after the second click.

Also for the windows, I think it is because my install things my computer has a touch screen. My friend has a touch screen for his win 10 machine, and had the same issues I had on my win8.

@jcubic
Copy link
Owner

jcubic commented Sep 1, 2017

The reason why it unfocus on click is that on mobile it need to toggle virtual keyboard, Maybe I can came up with better detect of mobile devices.

@jcubic
Copy link
Owner

jcubic commented Sep 1, 2017

I've replaced touch detection with mobile detection using user agent, it should work now the same with touch screens like or normal screen when not on mobile devices, but for iPhone/Android it will disable terminal so it can hide virtual keyboard.

@jcubic
Copy link
Owner

jcubic commented Sep 12, 2017

released in version 1.7.0

@jcubic jcubic closed this as completed Sep 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants