design-system-react icon indicating copy to clipboard operation
design-system-react copied to clipboard

Align SLDS and DSR dropdown markup [21]

Open interactivellama opened this issue 10 years ago • 12 comments

SLDS markup has dividers as pure hr and not within li and uses multiple uls when there is divider.

I wonder how the aria-labelled-by works with multiple uls and headers

UPDATE: Dropdowns should remain one ul, but still need updating

interactivellama avatar Aug 09 '16 18:08 interactivellama

Screenshot of SLDS vs DSR in marketing cloud app

image more details available here https://jira.exacttarget.com:8443/browse/MCGLOBALNV-626

swilliamset avatar Aug 10 '16 19:08 swilliamset

Why is there a section for each item? These are supposed to be section dividers for different <ul> tags. If match SLDS, it would be three lists inside the one menu.

interactivellama avatar Aug 10 '16 19:08 interactivellama

/shrug

that's how it comes back from the email app image

backwards compatibility we simply render the menu as it's requested

swilliamset avatar Aug 10 '16 19:08 swilliamset

Do we want to go with multiple uls in the dropdown menu markup with the divider between each ul?

interactivellama avatar Aug 17 '16 20:08 interactivellama

Sounds like that's the SLDS pattern now? I'm not sure that it was when the dropdown menus were originally coded

tweettypography avatar Aug 17 '16 20:08 tweettypography

Going to clarify the design specifics for the Marketing Cloud here.

futuremint avatar Aug 22 '16 18:08 futuremint

SLDS dropdown menu used in global nav markup appears to have changed. It is no longer using multiple uls and an hr as a divider. See the example below.

Sorry i should have included the markup earlier.

SLDS markup from Sprint 17

<ul class="dropdown__list" role="menu">
    <li class="slds-dropdown__item" role="presentation">
        <a href="javascript:void(0);" role="menuitem" tabindex="-1">
            <span class="slds-truncate">
                <svg aria-hidden="true" class="slds-icon slds-icon--x-small slds-icon-text-default slds-m-right--x-small">
                    <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#add"></use>
                </svg>Main action</span>
        </a>
    </li>
    <li class="slds-dropdown__header slds-has-divider--top-space" role="separator">
        <span class="slds-text-title--caps">Menu header</span>
    </li>
    <li class="slds-dropdown__item" role="presentation">
        <a href="javascript:void(0);" role="menuitem" tabindex="-1">
            <span class="slds-truncate">Menu Item One</span>
        </a>
    </li>
    <li class="slds-dropdown__item" role="presentation">
        <a href="javascript:void(0);" role="menuitem" tabindex="-1">
            <span class="slds-truncate">Menu Item Two</span>
        </a>
    </li>
    <li class="slds-dropdown__item" role="presentation">
        <a href="javascript:void(0);" role="menuitem" tabindex="-1">
            <span class="slds-truncate">Menu Item Three</span>
        </a>
    </li>
</ul>

DSR markup rendered in global nav

<ul aria-labelledby="BJbCmlCa5" class="dropdown__list slds-dropdown--length-5" role="menu">
    <li aria-selected="false" class="slds-dropdown__item" id="BJbCmlCa5-item-0" role="presentation">
        <a href="javascript:void(0);" data-index="0" role="menuitem" tabindex="-1">
            <span class="slds-truncate">
                <!-- react-text: 6 -->Sends<!-- /react-text -->
            </span>
        </a>
    </li>
    <li class="slds-has-divider">
    </li>
    <li aria-selected="false" class="slds-dropdown__item" id="BJbCmlCa5-item-2" role="presentation">
        <a href="javascript:void(0);" data-index="2" role="menuitem" tabindex="-1">
            <span class="slds-truncate">
                <!-- react-text: 11 -->Reports<!-- /react-text -->
            </span>
        </a>
    </li>
    <li class="slds-has-divider">
    </li>
    <li aria-selected="false" class="slds-dropdown__item" id="BJbCmlCa5-item-4" role="presentation">
        <a href="javascript:void(0);" data-index="4" role="menuitem" tabindex="-1">
            <span class="slds-truncate">
                <!-- react-text: 16 -->Data<!-- /react-text -->
            </span>
        </a>
    </li>
</ul>

swilliamset avatar Aug 26 '16 14:08 swilliamset

Who's pattern has changed? MC Global Nav or SLDS? Are you saying this is no longer an issue for Global Nav and should be de-prioritized?

interactivellama avatar Aug 26 '16 14:08 interactivellama

SLDS. They updated the examples in global nav to use menu component items 15 days ago https://github.com/salesforce-ux/design-system-internal/commit/cbe5c7b6440f2bba85dd2c3e92849c6f081bf26a#diff-eca935fa855555e88de4917fcb224ad0

swilliamset avatar Aug 26 '16 14:08 swilliamset

Sounds good. Thanks for the update. This should be easier now.

interactivellama avatar Aug 26 '16 14:08 interactivellama

all dropdown menu's should be aligned with the correct class, which I believe is slds-dropdown and not slds-dropdown-menu

interactivellama avatar Aug 26 '16 17:08 interactivellama

A divider between items is still pretty big, but I believe that would be an SLDS issue.

screen shot 2016-08-30 at 3 57 31 pm

interactivellama avatar Aug 30 '16 19:08 interactivellama