New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 687729 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Mac
Pri: 3
Type: Bug



Sign in to add a comment

MD Settings: Languages overflow menu button might have no options

Project Member Reported by michae...@chromium.org, Feb 1 2017

Issue description

If you only have one language enabled, you've disabled the global Offer to Translate setting ("translate.enabled"), and you're on Mac or Linux (no UI language setting), then the overflow menu for that language is empty.

In this case, is WAI that each item is hidden. But the result is an overflow button that appears to do nothing -- without menu items, the menu has no size, I guess.

We could fix this by hiding or disabling the overflow button for the language in this case, but it's a huge pain to detect: each menu item has its own logic for when it's displayed, so we would have to duplicate all of that logic into one giant function just for this polish issue.

If we really want to fix it, a better way might be to create a new computed property that controls each of the menu items:

    /** Which overflow menu items to show. */
    detailMenuItems_: {
      type: Object,
      value: () => {
        uiLanguageItem: false,
        offerTranslations: false,
        moveToTop: false,
        // ....
      }
    }

Then, for each menu item, move its
    hidden$="[[showFoo(item.blah, languages.enabled)]]"
annotation to an observer:

    observers: [
      'showHideFoo(item.blah, languages.enabled)',
      'showHideBar(....)',
      // ....
    ]

Now we can simplify the HTML: each menu item just binds something like
    hidden$="[[detailMenuItems_.moveToTo]]"

And we can very easily have a computed method for hiding the overflow button entirely when all of |detailMenuItems_|'s properties are false.

This can also prevent showing the <hr> when there is only one item in the menu.
 

Comment 1 by dbeam@chromium.org, Feb 7 2017

Labels: Hotlist-MD-Settings-Languages
Might be related to crbug/722622
Project Member

Comment 3 by sheriffbot@chromium.org, Jun 21 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment