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

Sometimes I missing focus when typing #37

Open
idx3d opened this issue Jul 18, 2016 · 18 comments
Open

Sometimes I missing focus when typing #37

idx3d opened this issue Jul 18, 2016 · 18 comments
Labels

Comments

@idx3d
Copy link

idx3d commented Jul 18, 2016

Hello guys,
Thanks a lot for your plug-in both creator and contributors.
I'm using OSX 10.11.5 (have used Yosemite as well).

The issue happens when I'm editing text in form or textarea – sometimes I loosing focus on field. This leads to sVim hotkeys got pressed instead of typing and mess begins. Unfocus happens randomly and start reproducing when I installed sVim.

I want to provide more info on that, but don't know where to grab logs.

Guys, I'm only one who facing this?

Thanks!

@flippidippi
Copy link
Owner

Can you tell me which sites this is happening on?

@hunsakerbn
Copy link

I see this too but only on a few sites. Will try to find one to link here.

@MartinAyla
Copy link

For me this happens with google search textareas (I use google.dk).

@wrtsprt
Copy link

wrtsprt commented Nov 25, 2016

I have the same problem. When I load a new page (i.e. http://google.com) the search field gets the initial focus. I start typing and the focus is lost after a couple of seconds.

The timeout seems to differ. On google.com I get nearly 10 seconds before the focus is gone. On some pages (depending on how I go there), it have 3 seconds.

@abrookins
Copy link
Collaborator

The issue here is that on a new page load, sVim loads its settings and then activates normal mode. Normal mode blurs the currently-active element, popping you out of the input. I'll see if I can find a better interaction, like perhaps putting you in insert mode if the active element is an input immediately after settings load; otherwise, activating normal model

abrookins added a commit that referenced this issue Aug 31, 2017
@abrookins
Copy link
Collaborator

Alright, beta release up for this issue: https://github.com/flipxfx/sVim/releases/tag/1.0.6-beta.1

@wrtsprt
Copy link

wrtsprt commented Sep 1, 2017

Quick test seems to solve the prob for my use case. Thanks! Don't have a lot of time to test now unfortunately.

@abrookins
Copy link
Collaborator

No problem! I'm noticing some oddness with this approach, but I'll keep working on it.

@amarendra
Copy link

.safariextz isn't released for this? Is there a simpler way to build/package that?

And yes, it this issue was (is) the reason I keep sVim paused for a good amount of time.

@abrookins
Copy link
Collaborator

I updated the beta with a .safariextz download: https://github.com/flipxfx/sVim/releases/tag/1.0.6-beta.1

That said, this doesn't seem like the right approach. The expected behavior with this plugin, like with cVim and Vimium, is that when pages load, you're popped out of any input elements, and the plugin is in normal mode. The problem here is that sometimes loading this plugin takes so long that you're in an input element for enough time to start typing, and then bumped out of it.

Now, we could always default to that behavior and have an option to not blur the current element after loading. And I can also try to track down the slow loading issue.

Anyway, I'll keep taking a look when I have time!

@amarendra
Copy link

Any workaround as of now (to disable everything else when in an input field, or make it load faster)? I thought this beta release has it fixed, right? Anyway, thanks for the build.

For me the problem is - I am typing something and suddenly the page reloads or something else happens:

  1. Always when I am typing too fast in a input field (I find it strange; and because of this I often pause sVim or actually type slowly), or
  2. Sometimes just out of the blue.

Have lost fair amount of typed text in Safari (as it doesn't have any extension like TextArea Cache like Firefox) and often I am logged out, tab closes, or another tab opens and focus is switched to the newly opened window or tab.

@jsonMartin
Copy link

jsonMartin commented Dec 14, 2017

I'm also having this issue, even after updating to the 1.0.6 Beta. On Google's page, I can't use the find command to focus the search button; I have to use the mouse to focus the search bar to begin typing.

@shaabhishek
Copy link

I have the same issue. Have the latest version. The problem is very well described by @amarendra

@deshearth
Copy link

Have the same issue with 1.0.6 version. Is it fixed in the latest release?

@abrookins
Copy link
Collaborator

No. I abandoned the approach I took in that beta because it had too many downsides, and I never came up with something better.

In my case the issue only ever happens with Google's homepage, so I set Safari's "New tabs open with" and "New windows open with" settings to "blank page" and I just type whatever I'm searching into the location bar, which then takes me to Google's search results. 🤷‍♂️

I don't have much (any?) time to spend on writing code for this plugin. However, I review PRs, merge them, and do releases with an Apple developer account I pay for just so we can keep using this plugin. New features and bug fixes usually depend on someone else being interested in the problem stepping up and working on it.

So, with that said, if you enjoy using Safari and would like to see this problem fixed, I invite you to set aside some of your free time, dig in, and try some JavaScripting! If you can't code, you can always use something like BountySource (https://www.bountysource.com) to put up bounties for particular bug fixes or features.

@isundaylee
Copy link
Contributor

isundaylee commented Nov 3, 2018

I did some digging into this today. It seems that (at least on google.com and amazon.com) what's been happening is that sVim is loaded multiple times for different iframes. sVim for the main iframe loads rather quickly, but several seconds later, some asynchronous iframe would cause sVim to be loaded again, therefore bumping the user out of focus.

I did a PR for a potential fix at #109. The basic gist is to only blur the user's focus upon the main iframe sVim load. It seems to fix the problem on my local setup. Before the change I was consistently bumped out of focus on Google homepage after couple seconds. After the change I'm no longer bumped out of focus.

@Hultner
Copy link

Hultner commented Nov 30, 2018

I've been having this problem a lot as well, especially on google. Could we possible get a fix to ban sVim from child iframes if there's no easy fix?

I switched from vimari when I upgrade to Safari 12 and had problems with that plugin. I love that you have the prevent default esc but this bug is incredibly annoying and I haven't had this behaviour with any other vim-style browsers plugin (used a bunch over the past ≈10 years).

@isundaylee
Copy link
Contributor

@Hultner I did PR #109 that maker sVim only blur the focus on the main iframe. Does that achieve what you have in mind? I seem to no longer get randomly bumped out of focus with that patch applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests