Skip to content

Menus showing up off screenΒ #8

@justintilson

Description

@justintilson

I'm trying to get your context menus working in a modal 'window' but they are not displaying where the right click occurs, instead they seem to be hanging off the bottom of the screen. It's not a z-index issue as yours (10000) is way higher than mine (1000). The following screenshot is the best way I can think of to illustrate what is going on:

context-menu-hiding

I'm quite certain I've set up my template as per your instructions.

<template>
  <div>
    <div class="item-wrapper" style="min-height: 500px;">
      <div class="fmgr-folder" v-for="folder in folders">
        <div @contextmenu.prevent.stop="handleClickFolder($event, folder)" class="item-wrapper__item">
          <img src="static/img/file-manager/icon-folder.png" />
          {{ folder.name }}
        </div>
      </div>
      <div class="fmgr-file" v-for="file in files">
        <div @contextmenu.prevent.stop="handleClickFile($event, file)" class="item-wrapper__item">
          <img :src="icon(file)" />
          {{ file.name }}
        </div>
      </div>
    </div>
    <vue-simple-context-menu
      elementId="folder-menu"
      :options="folderOptions()"
      ref="folderContextMenu"
      @optionClicked="optionClicked">
    </vue-simple-context-menu>
    <vue-simple-context-menu
      elementId="file-menu"
      :options="fileOptions()"
      ref="fileContextMenu"
      @optionClicked="optionClicked">
    </vue-simple-context-menu>
  </div>
</template>

CSS is imported and successfully hiding the content of :options

import VueSimpleContextMenu from 'vue-simple-context-menu'
import 'vue-simple-context-menu/dist/vue-simple-context-menu.css'

The showMenu function is being called as expected. Seems like a CSS conflict of some sort.

this.$refs.folderContextMenu.showMenu(event, item)

Any suggestions on where to poke at the CSS?

EDIT: If I manually change the top and left values in Chrome's Inspect window, I'm able to get move the menu on to the screen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions