• Hello,

    I believe I may have found a bug in the WordPress core implementation. When the width of browser window is reduced, the items in the admin bar are overwriting items in the Enfold top menu, Enfold being the theme employed by the site. I have discussed the problem with the Enfold maintainers, which led to the conclusion that the problem is with WordPress core. The discussion on the Enfold theme forum may be found here: https://kriesi.at/support/topic/top-bar-overwriting-the-top-menu/#post-1314745.

    The normal situation with a wide browser window is shown in the following image:

    https://drive.google.com/file/d/1CfkWRAx2v3kv2fwsohyDIeGEkwZvfSDA/view?usp=sharing

    When the browser window is narrowed by dragging the right hand side of the browser window to the left, the admin bar elements on the right drop down overwrite the Enfold top menu items, as shown in the following image:

    https://drive.google.com/file/d/15lhI5awCfCZMq17uzXIAccM4Uw-2HrBO/view?usp=sharing

    In detail, when the admin bar right side is forced into the middle, it encounters other admin bar items. Instead of expanding the vertical height of the admin bar and then writing the right hand items below the left hand items, the code controlling its style is placing the right hand items in the next vertical space, which holds the top menu items.

    I have implemented a temporary workaround by adding code to the Code Snippets plugin that reduces the items in the admin bar. However, this is not a general solution, since some sites may wish to to retain some of these items.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    The issue is there are several added admin bar elements that are not there by default. The admin bar works correctly without any added elements, so I don’t think we can say it’s a core bug. The issue is with whatever plugins added more elements. Ideally they would alter the CSS breakpoints which switch to icon mode to occur at a wider viewport.

    The problem is any one plugin cannot know what other plugins are doing and the breakpoint chosen has to accommodate all added elements. There’s no clear way for plugins to determine this. The correct breakpoint will be site specific and would need to be left to the site admin to determine. But there’s no simple “switch to icon mode when less than” value we can specify. Altering the breakpoint would involve overriding the default CSS with custom admin CSS.

    Thread Starter dnessett

    (@dnessett)

    While I am unfamiliar with the code implementing the admin bar, I would like you to reconsider the conclusion that this is not a bug. I understand that plugins add elements to the admin bar and therefore it is not possible for you to control when the items the core places there (e.g., the “Howdy, …” item) “hit” those plugin elements when the right edge of the browser is brought to the left. However, I do think the behavior of the admin bar is under your control.

    For example, when the right hand edge of the browser window is moved to the left, eventually, the “Howdy,…” item collides with items on the left. At that point, the styling of the admin bar comes into play. Specifically, it drops the “Howdy, …” item down into space inhabited by the Enfold top menu, which causes the overwriting. Again, I don’t know how the styling of the top bar is implemented, but it seems to me when this collision occurs, the code could double the vertical space allocated to the admin bar, allowing the items on the right to drop down without leaving the confines of the admin bar.

    If this is not possible, then at least it should be possible to provide configuration logic that allows sites to increase the vertical space allocated to the admin bar. While this would increase this vertical space unconditionally, at least it should solve the collision problem.

    Moderator bcworkz

    (@bcworkz)

    I agree it’s an issue that ought to be better handled. The solution is not as simple as it may seem. You are correct, it’s a styling issue. The problem is CSS cannot tell on its own when there’s an element collision. I’m not very good with JavaScript, but I believe it’s possible for JavaScript to take the various element widths into consideration and set related styling as appropriate. Currently there’s nothing that does this, but there’s always room for improvement.

    I recommend opening a Trac ticket so the issue can be properly tracked and acted upon. Please first make a reasonable search effort to ensure there’s not already a similar ticket in existence.

    Thread Starter dnessett

    (@dnessett)

    I have created a bug report. The Trac ticket is: https://core.trac.www.ads-software.com/ticket/53933#ticket.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘admin bar overwrites top menu when browser width reduced’ is closed to new replies.