php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80177 Bug tracker package affected lists behave wrong in Safari
Submitted: 2020-10-02 16:53 UTC Modified: 2020-10-02 22:36 UTC
From: php-bugs-2020 at ryandesign dot com Assigned:
Status: Open Package: Website problem
PHP Version: Irrelevant OS: macOS 10.13.6
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2020-10-02 16:53 UTC] php-bugs-2020 at ryandesign dot com
Description:
------------
In this bug tracker, the "Package affected" lists are intended to function as a two-level selector: first you select the category in the leftmost list, then the rightmost list populates with more specific problem types in that category.

This works fine for me in Google Chrome on macOS. When the page loads, no selection is made in the leftmost list and the rightmost list is empty except for the instruction to select a category. Selecting an item in the leftmost list populates the relevant list of choices in the rightmost list.

But it does not work in Apple Safari on macOS. In Safari, it works exactly backward. When the page loads, no selection is made in the leftmost list and EVERY CATEGORY'S SUBITEMS are shown in the rightmost list. Selecting any category in the leftmost list HIDES THAT CATEGORY'S SUBITEMS in the rightmost list. It has been this way forever.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-02 16:56 UTC] php-bugs-2020 at ryandesign dot com
Here is a screenshot showing the difference between what happens in Chrome and what happens in Safari:

http://ryandesign.com/tmp/bugs.php.net.screen.shot.2020-10-02.png
 [2020-10-02 22:36 UTC] php-bugs-2020 at ryandesign dot com
I think I understand your package-affected.js script now and how this UI widget works. The rightmost list is the only list in the HTML and it defines an optgroup for each category and options inside them. The JavaScript builds the leftmost list by using the optgroup names. It then applies style="display:none" to the optgroups on the right so that they disappear. When selecting something in the leftmost list, all of the options from the corresponding optgroup in the rightmost list are moved to the top level of the rightmost list and become visible.

The problem seems to just be that Safari does not honor style="display:none" on optgroups. The list manipulation is working, I just have to scroll all the way to the bottom of the rightmost list to see the items from the currently selected category.

Here is a WebKit bug report from 2006 about not supporting style="display:none" on options:

https://bugs.webkit.org/show_bug.cgi?id=8351

Here's one from 2011 about not supporting style="display:hidden" on optgroups:

https://bugs.webkit.org/show_bug.cgi?id=69014

Since WebKit seems not to be fixing these, perhaps your JavaScript could use a different strategy. For example, the original full select list could be hidden entirely and two new visible select lists could be created: the leftmost one the same way it is now, and the rightmost one would be created empty except for the "select a category" instructions, and when a category is selected, the instructions element would be deleted and the relevant options from the hidden list would be moved to the visible list.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Nov 25 13:01:25 2020 UTC