Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KDropdownMenu in KModal: Dropdown menu does not display in KModal #486

Closed
LianaHarris360 opened this issue Nov 8, 2023 · 3 comments · Fixed by #493
Closed

KDropdownMenu in KModal: Dropdown menu does not display in KModal #486

LianaHarris360 opened this issue Nov 8, 2023 · 3 comments · Fixed by #493
Assignees
Labels
bug Component: KDropdownMenu help wanted Open source contributors welcome

Comments

@LianaHarris360
Copy link
Member

Product

Design System

Expected behavior

When KButton and KDropdownMenu is used within KModal, clicking on the button should display the dropdown menu.

Actual behavior

When KModal contains KDropdownMenu within KButton, the dropdown menu is not shown when clicking on the button.

Steps to reproduce the issue

  1. Run the KDS documentation development server.
  2. Temporarily update docs/pages/kmodal.vue with the code:
<template>

  <DocsPageTemplate apiDocs>
    <DocsPageSection title="Overview" anchor="#overview">
      For design guidance, see the page on <DocsInternalLink href="/modals" text="modals" />.
      <KButton text="open kmodal" :primary="true" appearance="raised-button" @click="modalShown = true" />
      <KModal
        v-if="modalShown"
        title="Test KDropdownMenu in KModal"
        submitText="close"
        @submit="modalShown = false"
      >
        <div>
          <KButton
            hasDropdown
            text="Options"
            :primary="false"
          >
            <KDropdownMenu
              style="margin-right: 16px;"
              text="Primary"
              :primary="false"
              :options="['Option 1', 'Option 2']"
              appearance="raised-button"
              position="left bottom"
            />
          </KButton>
        </div>
      </KModal>
    </DocsPageSection>
  </DocsPageTemplate>

</template>


<script>

  import KButton from '../../lib/buttons-and-links/KButton';
  import KDropdownMenu from '../../lib/KDropdownMenu';

  export default {
    components: {
      KButton,
      KDropdownMenu,
    },
    data() {
      return {
        modalShown: false,
      };
    },
  };

</script>


<style lang="scss" scoped></style>
  1. Navigate to KModal documentation page to test usage of KButton and KDropdownMenu

Additional information

It could potentially be a z-index issue. If you look closely, when the button is clicked, a slight shadow appears behind the KModal component that could be the dropdown menu.

KDropdownMenu.mov
@MisRob MisRob added the help wanted Open source contributors welcome label Nov 9, 2023
@KshitijThareja
Copy link
Contributor

Hi @MisRob.
I'd like to work on this issue. Can you please assign it to me? I'll set it up today and will give you an update on this in a day or two.

@MisRob
Copy link
Member

MisRob commented Nov 24, 2023

Hi @KshitijThareja, yes, thank you for volunteering!

@KshitijThareja
Copy link
Contributor

@LianaHarris360 @MisRob
Changing the z-index value to 99 in the lib/KDropownMenu.vue did fix the issue. I just wanted to confirm if you're fine with this change or if there's anything you'd like to add to this before I make the PR.

Here's the screenshot after making the changes:

proof

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Component: KDropdownMenu help wanted Open source contributors welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants