Moodle 4 : Focus error fix (atto plugins)

Moodle 4 : Focus error fix (atto plugins)

I was hitting upon an error in one of my atto plugins whenever I clicked on a button in my dialogue form. It also appears when you use the Atto Styles button on the toolbar.

Uncaught RangeError: Maximum call stack size exceeded.

This appears to be a known bug see tracker

Using the information given by Jake Dallimore in the comments I added the following to my _displayDialogue function in my YUI module.

require(['core/local/aria/focuslock'], function(FocusLockManager) {
	// We don't want to trap focus.
	FocusLockManager.untrapFocus();
});

From the comments it seems as though what’s happening is we are ending up with two active focuses when there should just be one. The code seems to work by untrapping the focus when the dialogue is opened so that there is only one again

Comments are closed.