Focus on modal content instead of container
Prevent unwanted jumps in page scroll position when opening a modal.
This commit is contained in:
parent
958bd092ba
commit
fdd0e556e7
|
@ -79,7 +79,7 @@
|
|||
render: function() {
|
||||
var template = wp.template( this._target );
|
||||
|
||||
this.$el.attr( 'tabindex' , '0' ).append(
|
||||
this.$el.append(
|
||||
template( this._string )
|
||||
);
|
||||
|
||||
|
@ -88,7 +88,8 @@
|
|||
}).append( this.$el );
|
||||
|
||||
this.resizeContent();
|
||||
this.$el.focus();
|
||||
this.$( '.wc-backbone-modal-content' ).attr( 'tabindex' , '0' ).focus();
|
||||
|
||||
$( document.body ).trigger( 'init_tooltips' );
|
||||
|
||||
$( document.body ).trigger( 'wc_backbone_modal_loaded', this._target );
|
||||
|
|
Loading…
Reference in New Issue