Fix flickering for embedded content on iPads
see https://github.com/h5p/h5p-moodle-plugin/issues/237pull/58/head moodle-1.16
parent
7b7b35ea39
commit
1a09b1a30e
|
@ -263,6 +263,11 @@ H5P.init = function (target) {
|
|||
var parentHeight = iframe.parentElement.style.height;
|
||||
iframe.parentElement.style.height = iframe.parentElement.clientHeight + 'px';
|
||||
|
||||
// Note: Force layout reflow
|
||||
// This fixes a flickering bug for embedded content on iPads
|
||||
// @see https://github.com/h5p/h5p-moodle-plugin/issues/237
|
||||
iframe.getBoundingClientRect();
|
||||
|
||||
// Reset iframe height, in case content has shrinked.
|
||||
iframe.style.height = '1px';
|
||||
|
||||
|
|
Loading…
Reference in New Issue