[wp-trac] [WordPress Trac] #57995: Popup flickering in Firefox

WordPress Trac noreply at wordpress.org
Fri Feb 9 09:06:53 UTC 2024


#57995: Popup flickering in Firefox
-------------------------------------+-------------------------------------
 Reporter:  robehr79                 |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Future Release
Component:  TinyMCE                  |     Version:  6.0
 Severity:  major                    |  Resolution:
 Keywords:  has-screenshots has-     |     Focuses:  javascript,
  testing-info needs-patch           |  administration
-------------------------------------+-------------------------------------

Comment (by robertehrenleitnerplus):

 The patch I provided 9 months ago can still be applied to the current
 version 6.4.3, as I have just made it on my own. Additionally, I found out
 that it is possible to use `container` instead of the newly introduced
 `containerElement`. Not even the line numbers have changed much:

 {{{
 --- a/wp-includes/js/tinymce/plugins/wordpress/plugin.js
 +++ b/wp-includes/js/tinymce/plugins/wordpress/plugin.js
 @@ -795,7 +795,8 @@ tinymce.PluginManager.add( 'wordpress', function(
 editor ) {
                         mceToolbar,
                         mceStatusbar,
                         wpStatusbar,
 -                       cachedWinSize;
 +                       cachedWinSize,
 +                       cachedScrollPos;

                         if ( container ) {
                                 mceToolbar = tinymce.$( '.mce-toolbar-
 grp', container )[0];
 @@ -1154,6 +1155,20 @@ tinymce.PluginManager.add( 'wordpress', function(
 editor ) {
                                                 }
                                         }

 +                                       if ( event.type === 'scroll' ||
 event.type === 'scrollwindow' ) {
 +                                               if ( cachedScrollPos ) {
 +                                                       if (
 container.scrollLeft === cachedScrollPos.X && container.scrollTop ===
 cachedScrollPos.Y ) {
 +                                                               return;
 +                                                       }
 +                                               } else {
 +                                                       cachedScrollPos =
 {
 +                                                               X:
 container.scrollLeft,
 +                                                               Y:
 container.scrollTop
 +                                                       };
 +                                                       return;
 +                                               }
 +                                       }
 +
                                         clearTimeout( timeout );

                                         timeout = setTimeout( function() {
 @@ -1165,6 +1180,7 @@ tinymce.PluginManager.add( 'wordpress', function(
 editor ) {

                                         activeToolbar.scrolling = true;
                                         activeToolbar.hide();
 +                                       cachedScrollPos = null;
                                 }
                         }
                 }
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57995#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list