diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2020-12-03 10:07:42 +0200 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2020-12-03 10:07:42 +0200 |
| commit | fa01030641de7be89206787f5e364318086e8524 (patch) | |
| tree | 5bbb3f698c32865799e6aea05c550de95a49a468 | |
| parent | f4b18df644907090516bf19c8f6c7b78e0b2bb43 (diff) | |
make click blocking actually work
| -rw-r--r-- | src/components/timeline_menu/timeline_menu.js | 8 | ||||
| -rw-r--r-- | src/components/timeline_menu/timeline_menu.vue | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/components/timeline_menu/timeline_menu.js b/src/components/timeline_menu/timeline_menu.js index ef8a5813..8d6a58b1 100644 --- a/src/components/timeline_menu/timeline_menu.js +++ b/src/components/timeline_menu/timeline_menu.js @@ -59,6 +59,14 @@ const TimelineMenu = { this.isOpen = true }, 25) }, + blockOpen (event) { + // For the blank area inside the button element. + // Just setting @click.stop="" makes unintuitive behavior when + // menu is open and clicking on the blank area doesn't close it. + if (!this.isOpen) { + event.stopPropagation() + } + }, timelineName () { const route = this.$route.name if (route === 'tag-timeline') { diff --git a/src/components/timeline_menu/timeline_menu.vue b/src/components/timeline_menu/timeline_menu.vue index dd8dbf34..3c86842b 100644 --- a/src/components/timeline_menu/timeline_menu.vue +++ b/src/components/timeline_menu/timeline_menu.vue @@ -72,7 +72,10 @@ icon="chevron-down" /> </span> - <span class="click-blocker" /> + <span + class="click-blocker" + @click="blockOpen" + /> </div> </Popover> </template> @@ -135,7 +138,6 @@ .click-blocker { cursor: default; - pointer-events: none; flex-grow: 1; } } |
