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

undo plugin forces a focus #711

Open
jdarwood007 opened this Issue Sep 30, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@jdarwood007

jdarwood007 commented Sep 30, 2018

The undo plugin seems to cause the browser to focus on the textarea field unexpectedly. This causes undesired results where the browser "jumps" to the textarea field on the page.

I traced this back:
at SCEditor.base.sourceEditorCaret (jquery.sceditor.bbcode.js?beta21:5751)
at SCEditor.base.signalReady (undo.js?beta21:138)
at callHandlers (jquery.sceditor.bbcode.js?beta21:2874)
at PluginManager.base.call (jquery.sceditor.bbcode.js?beta21:2893)
at loaded (jquery.sceditor.bbcode.js?beta21:4399)

The undo plugin calls this

				'caret': this.sourceEditorCaret(),

This call does this:

		base.sourceEditorCaret = function (position) {
			sourceEditor.focus();

This calls the focus() on the textarea element which causes the browser to jump to it.
Our original report: SimpleMachines/SMF2.1#4749

@brunoais

This comment has been minimized.

Show comment
Hide comment
@brunoais

brunoais Sep 30, 2018

Collaborator

How did you activate the undo plugin while not interacting with the editor?
What steps did you go through to achieve that?

The undo plugin only reacts to CTRL+Z and CTRL+Y (additional to CTRL+SHIFT+Z).
SCE plugin system also is supposed to only react if either the textarea or the WYSIWYG editor is focused, otherwise, the plugin's handler is not executed.

Collaborator

brunoais commented Sep 30, 2018

How did you activate the undo plugin while not interacting with the editor?
What steps did you go through to achieve that?

The undo plugin only reacts to CTRL+Z and CTRL+Y (additional to CTRL+SHIFT+Z).
SCE plugin system also is supposed to only react if either the textarea or the WYSIWYG editor is focused, otherwise, the plugin's handler is not executed.

@brunoais brunoais added the Needs Info label Sep 30, 2018

@jdarwood007

This comment has been minimized.

Show comment
Hide comment
@jdarwood007

jdarwood007 Sep 30, 2018

The editor is fully loaded on page load and the plugins and other options are loaded when the sceditor object is setup. So the undo plugin is passed into sceditor.create under the options.plugins array.

jdarwood007 commented Sep 30, 2018

The editor is fully loaded on page load and the plugins and other options are loaded when the sceditor object is setup. So the undo plugin is passed into sceditor.create under the options.plugins array.

@brunoais

This comment has been minimized.

Show comment
Hide comment
@brunoais

brunoais Sep 30, 2018

Collaborator

When did the jump to the editor happen?
Did you have to press any of the required keys (see above)?

Collaborator

brunoais commented Sep 30, 2018

When did the jump to the editor happen?
Did you have to press any of the required keys (see above)?

@jdarwood007

This comment has been minimized.

Show comment
Hide comment
@jdarwood007

jdarwood007 Oct 2, 2018

It jumps upon page load. No keys are pressed.

jdarwood007 commented Oct 2, 2018

It jumps upon page load. No keys are pressed.

@brunoais brunoais added Bug and removed Needs Info labels Oct 3, 2018

@brunoais brunoais self-assigned this Oct 3, 2018

@brunoais

This comment has been minimized.

Show comment
Hide comment
@brunoais

brunoais Oct 3, 2018

Collaborator

Ok, got it. The bug does exist. I guess the extension was not adapted when SCE's code changed.
I expect to fix that the weekend next week... Hope so...

Collaborator

brunoais commented Oct 3, 2018

Ok, got it. The bug does exist. I guess the extension was not adapted when SCE's code changed.
I expect to fix that the weekend next week... Hope so...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment