Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FIX Prevent defocus on first change in CMS HTMLEditorField (fixes #8217)

  • Loading branch information...
commit eb7fed9ab5d78b5da6d568f0db3396c34ae8cc57 1 parent c72ba4e
@chillu chillu authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 admin/javascript/LeftAndMain.EditForm.js
View
5 admin/javascript/LeftAndMain.EditForm.js
@@ -108,7 +108,10 @@
// specifically opt-out of this behaviour via "data-skip-autofocus".
// This opt-out is useful if the first visible field is shown far down a scrollable area,
// for example for the pagination input field after a long GridField listing.
- this.find(':input:not(:submit)[data-skip-autofocus!="true"]').filter(':visible:first').focus();
+ // Skip if an element in the form is already focused.
+ if(!this.find(document.activeElement).length) {
+ this.find(':input:not(:submit)[data-skip-autofocus!="true"]').filter(':visible:first').focus();
+ }
},
onunmatch: function() {
this._super();
Please sign in to comment.
Something went wrong with that request. Please try again.