Fix problem with autocomplete which closes when mouse is used. #8435

Closed
marijnh wants to merge 1 commit from github/fork/angelozerr/master into master
marijnh commented 2013-02-22 11:45:30 +01:00 (Migrated from gitlab.com)

Hi Marijn,

I have already (but not every time-() the problems with the completion which closes when I use the mouse (click on scrollbar or inside the list) (see https://github.com/marijnh/CodeMirror/issues/1264).

To have every time the bug, you can change the timeout like this :


function onBlur(){ closingOnBlur = setTimeout(close, 1); };

So I send you a (simple patch) which fix teh problem. The basic idea is to ignore the onBlur when mouse is inside the completion list.

Regards Angelo

Hi Marijn, I have already (but not every time-() the problems with the completion which closes when I use the mouse (click on scrollbar or inside the list) (see https://github.com/marijnh/CodeMirror/issues/1264). To have every time the bug, you can change the timeout like this : --- ## function onBlur(){ closingOnBlur = setTimeout(close, 1); }; So I send you a (simple patch) which fix teh problem. The basic idea is to ignore the onBlur when mouse is inside the completion list. Regards Angelo
marijnh commented 2013-02-22 11:46:03 +01:00 (Migrated from gitlab.com)

mentioned in issue #1264

mentioned in issue #1264
marijnh commented 2013-02-22 11:56:08 +01:00 (Migrated from gitlab.com)

Aha, you were clicking the scrollbar of the completion pop-up. I thought you were talking about the scrollbar of the editor (which did initially have the same problem). That explains why I couldn't reproduce this.

Aha, you were clicking the scrollbar **of the completion pop-up**. I thought you were talking about the scrollbar of the editor (which did initially have the same problem). That explains why I couldn't reproduce this.
marijnh commented 2013-02-22 12:10:34 +01:00 (Migrated from gitlab.com)

Please see 612b3d2cbf and verify whether it solves your problem.

Please see 612b3d2cbfc2f654bec5f7e9af670667e8d53d1f and verify whether it solves your problem.
marijnh (Migrated from gitlab.com) closed this pull request 2013-02-22 12:10:34 +01:00
marijnh commented 2013-02-22 14:24:46 +01:00 (Migrated from gitlab.com)

It works well with Chrome and FF, but not with IE8. My patch resolved IE too.

It works well with Chrome and FF, but not with IE8. My patch resolved IE too.
marijnh commented 2013-02-22 15:03:07 +01:00 (Migrated from gitlab.com)

I (once again) can't reproduce the problem anymore in IE8. What I do is open the completion demo, put the cursor somewhere where it's not in a word, press ctrl-space, and scroll the resulting (long) list of completions by clicking the scrollbar of the pop-up.

Make sure your cache is cleared, etc.

Your patch caused the editor to be deselected when scrolling the widget, used onmouseleave naively (it will also fire when the mouse is moving between elements inside the widget), and generally added more complexity than needed.

I (once again) can't reproduce the problem anymore in IE8. What I do is open the completion demo, put the cursor somewhere where it's not in a word, press ctrl-space, and scroll the resulting (long) list of completions by clicking the scrollbar of the pop-up. Make sure your cache is cleared, etc. Your patch caused the editor to be deselected when scrolling the widget, used `onmouseleave` naively (it will also fire when the mouse is moving between elements inside the widget), and generally added more complexity than needed.
marijnh commented 2013-02-22 15:52:56 +01:00 (Migrated from gitlab.com)

I have cleand my cache etc

The bug is very hard to reproduce (sometimes it comes every time and
sometimes never -().

It comes often when the list opens (and the mouse is not inside in the
opened list) and I scroll quicly several times the scrollbar on t e rigth
of the list , the list closes.

2013/2/22 Marijn Haverbeke notifications@github.com

I (once again) can't reproduce the problem anymore in IE8. What I do is
open the completion demo, put the cursor somewhere where it's not in a
word, press ctrl-space, and scroll the resulting (long) list of completions
by clicking the scrollbar of the pop-up.

Make sure your cache is cleared, etc.

Your patch caused the editor to be deselected when scrolling the widget,
used onmouseleave naively (it will also fire when the mouse is moving
between elements inside the widget), and generally added more complexity
than needed.


Reply to this email directly or view it on GitHubhttps://github.com/marijnh/CodeMirror/pull/1277#issuecomment-13944430.

I have cleand my cache etc The bug is very hard to reproduce (sometimes it comes every time and sometimes never -(). It comes often when the list opens (and the mouse is not inside in the opened list) and I scroll quicly several times the scrollbar on t e rigth of the list , the list closes. 2013/2/22 Marijn Haverbeke notifications@github.com > I (once again) can't reproduce the problem anymore in IE8. What I do is > open the completion demo, put the cursor somewhere where it's not in a > word, press ctrl-space, and scroll the resulting (long) list of completions > by clicking the scrollbar of the pop-up. > > Make sure your cache is cleared, etc. > > Your patch caused the editor to be deselected when scrolling the widget, > used onmouseleave naively (it will also fire when the mouse is moving > between elements inside the widget), and generally added more complexity > than needed. > > — > Reply to this email directly or view it on GitHubhttps://github.com/marijnh/CodeMirror/pull/1277#issuecomment-13944430.
marijnh commented 2013-02-25 10:22:21 +01:00 (Migrated from gitlab.com)

It comes often when the list opens (and the mouse is not inside in the
opened list) and I scroll quicly several times the scrollbar on t e rigth
of the list , the list closes.

I'm still not managing to reproduce this. You'll have to debug it yourself.

> It comes often when the list opens (and the mouse is not inside in the > opened list) and I scroll quicly several times the scrollbar on t e rigth > of the list , the list closes. I'm still not managing to reproduce this. You'll have to debug it yourself.
marijnh commented 2013-02-25 10:28:54 +01:00 (Migrated from gitlab.com)

Ok, that's shame for me-(

I will try to debug it (but very hard with IE tools) when I will have time.

Regards Angelo

2013/2/25 Marijn Haverbeke notifications@github.com

It comes often when the list opens (and the mouse is not inside in the
opened list) and I scroll quicly several times the scrollbar on t e rigth
of the list , the list closes.

I'm still not managing to reproduce this. You'll have to debug it
yourself.


Reply to this email directly or view it on GitHubhttps://github.com/marijnh/CodeMirror/pull/1277#issuecomment-14031958.

Ok, that's shame for me-( I will try to debug it (but very hard with IE tools) when I will have time. Regards Angelo 2013/2/25 Marijn Haverbeke notifications@github.com > > It comes often when the list opens (and the mouse is not inside in the > > opened list) and I scroll quicly several times the scrollbar on t e rigth > > of the list , the list closes. > > I'm still not managing to reproduce this. You'll have to debug it > yourself. > > — > Reply to this email directly or view it on GitHubhttps://github.com/marijnh/CodeMirror/pull/1277#issuecomment-14031958.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/codemirror5!8435
No description provided.