Automatic width plugin unreliable on Safari

Created on 3 July 2017, over 7 years ago
Updated 25 July 2023, over 1 year ago

The automatic width feature provided by sfautomaticwidth.js in Superfish library 1.x has become unreliable in recent versions of desktop Safari, probably beginning with 10.0 or 10.1. The symptom is that the top-level menu sometimes appears collapsed, showing no padding between items. It occurs most frequently on the initial page load, often resolving itself after a refresh. A review of how the automatic width plugin works suggests a mechanism: it appears that Safari doesn't always fire the window resize event on page load. Based on that assumption, I've replaced line 64 in sfautomaticwidth.js:

$(window).resize(function(){

with:

$(window).on('load resize', function() {

to trigger upon the load event as well as the resize event. This has reliably corrected the problem in Safari for me, and introduced no observable problems in Chrome, Firefox, IE11, or Edge.

πŸ› Bug report
Status

Closed: outdated

Version

2.0

Component

Superfish Library

Created by

πŸ‡ΊπŸ‡ΈUnited States jerry

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024