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

Workaround for #3261 Selection problem in IE11, when leaving an iframe while selecting #3272

Closed
wants to merge 3 commits into from

Conversation

pstadermann
Copy link

If the mouse leaves the iframe during text selection, the MouseEvents are no longer sent to Codemirror. If the user lets go of the left mouse button, CodeMirror does not know that the text selection has stopped.

Chrome and Firefox allow to check the states of the mouse buttons on mouse move. Codemirror does this and stops the text selection. This does not work on any version of IE.

Workaround for IE: Check on each left click, if text is currently being selected. If yes, the selection is finished. This is not perfect, but prevents Codemirror from starting a second text selection and going crazy.

Philip Stadermann added 3 commits May 20, 2015 13:11
…le selecting

Make sure, that we're not starting a second selection.
…le selecting

Make sure, that we're not starting a second selection.
// #3261: make sure, that we're not starting a second selection
if (cm.state.selectingText) {
cm.state.selectingText(e);
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not check this in onMouseDown? That'd also save the extra condition above (when deciding between a drag and a select).

@marijnh
Copy link
Member

marijnh commented Jul 31, 2015

Merged in slightly changed form as b22783d

@marijnh marijnh closed this Jul 31, 2015
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

Successfully merging this pull request may close these issues.

None yet

2 participants