Skip to content

Commit

Permalink
fix: avoid click propagation when clicking child
Browse files Browse the repository at this point in the history
Signed-off-by: Martichou <m@rtin.fyi>
  • Loading branch information
Martichou committed Jul 8, 2024
1 parent 8a8185e commit 614bcbc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
16 changes: 8 additions & 8 deletions app/legacy/src/components/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,12 @@
</p>
<div class="flex flex-row justify-end gap-4 mt-1">
<p
@click="sendCmd(vm, item.id, 'AcceptTransfer')" class="btn px-3
@click.stop="sendCmd(vm, item.id, 'AcceptTransfer')" class="btn px-3
rounded-xl active:scale-95 transition duration-150 ease-in-out shadow-none">
Accept
</p>
<p
@click="sendCmd(vm, item.id, 'RejectTransfer')" class="btn px-3
@click.stop="sendCmd(vm, item.id, 'RejectTransfer')" class="btn px-3
rounded-xl active:scale-95 transition duration-150 ease-in-out shadow-none">
Decline
</p>
Expand All @@ -265,7 +265,7 @@
</p>
<div class="flex flex-row justify-end gap-4 mt-1">
<p
@click="sendCmd(vm, item.id, 'CancelTransfer')" class="btn px-3
@click.stop="sendCmd(vm, item.id, 'CancelTransfer')" class="btn px-3
rounded-xl active:scale-95 transition duration-150 ease-in-out shadow-none">
Cancel
</p>
Expand All @@ -284,12 +284,12 @@
</p>
<div class="flex flex-row justify-end gap-4 mt-1">
<p
v-if="item.destination" @click="invoke('open_url', { message: item.destination })"
v-if="item.destination" @click.stop="invoke('open_url', { message: item.destination })"
class="btn px-3 rounded-xl active:scale-95 transition duration-150 ease-in-out shadow-none">
Open
</p>
<p
@click="removeRequest(vm, item.id)" class="btn px-3
@click.stop="removeRequest(vm, item.id)" class="btn px-3
rounded-xl active:scale-95 transition duration-150 ease-in-out shadow-none">
Clear
</p>
Expand All @@ -302,7 +302,7 @@
</p>
<div class="flex flex-row justify-end gap-4 mt-1">
<p
@click="removeRequest(vm, item.id)" class="btn px-3
@click.stop="removeRequest(vm, item.id)" class="btn px-3
rounded-xl active:scale-95 transition duration-150 ease-in-out shadow-none">
Clear
</p>
Expand All @@ -315,7 +315,7 @@
</p>
<div class="flex flex-row justify-end gap-4 mt-1">
<p
@click="removeRequest(vm, item.id)" class="btn px-3
@click.stop="removeRequest(vm, item.id)" class="btn px-3
rounded-xl active:scale-95 transition duration-150 ease-in-out shadow-none">
Clear
</p>
Expand All @@ -328,7 +328,7 @@
</p>
<div class="flex flex-row justify-end gap-4 mt-1">
<p
@click="removeRequest(vm, item.id)" class="btn px-3
@click.stop="removeRequest(vm, item.id)" class="btn px-3
rounded-xl active:scale-95 transition duration-150 ease-in-out shadow-none">
Clear
</p>
Expand Down
9 changes: 9 additions & 0 deletions app/legacy/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
import AutoImport from 'unplugin-auto-import/vite'
import { defineConfig } from 'vitest/config'
import path from 'path'

// See https://vitejs.dev/config/
export default defineConfig({
Expand All @@ -22,6 +23,14 @@ export default defineConfig({
server: {
port: 1420,
strictPort: true,
fs: {
allow: [
// Resolve the path dynamically
path.resolve(__dirname, '../common/vue_lib'),
// Optionally, include other directories
path.resolve(__dirname)
]
}
},
build: {
outDir: './dist',
Expand Down
16 changes: 8 additions & 8 deletions app/main/src/components/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,12 @@
</p>
<div class="flex flex-row justify-end gap-4 mt-1">
<p
@click="sendCmd(vm, item.id, 'AcceptTransfer')" class="btn px-3
@click.stop="sendCmd(vm, item.id, 'AcceptTransfer')" class="btn px-3
rounded-xl active:scale-95 transition duration-150 ease-in-out shadow-none">
Accept
</p>
<p
@click="sendCmd(vm, item.id, 'RejectTransfer')" class="btn px-3
@click.stop="sendCmd(vm, item.id, 'RejectTransfer')" class="btn px-3
rounded-xl active:scale-95 transition duration-150 ease-in-out shadow-none">
Decline
</p>
Expand All @@ -265,7 +265,7 @@
</p>
<div class="flex flex-row justify-end gap-4 mt-1">
<p
@click="sendCmd(vm, item.id, 'CancelTransfer')" class="btn px-3
@click.stop="sendCmd(vm, item.id, 'CancelTransfer')" class="btn px-3
rounded-xl active:scale-95 transition duration-150 ease-in-out shadow-none">
Cancel
</p>
Expand All @@ -284,12 +284,12 @@
</p>
<div class="flex flex-row justify-end gap-4 mt-1">
<p
v-if="item.destination" @click="invoke('open_url', { message: item.destination })"
v-if="item.destination" @click.stop="invoke('open_url', { message: item.destination })"
class="btn px-3 rounded-xl active:scale-95 transition duration-150 ease-in-out shadow-none">
Open
</p>
<p
@click="removeRequest(vm, item.id)" class="btn px-3
@click.stop="removeRequest(vm, item.id)" class="btn px-3
rounded-xl active:scale-95 transition duration-150 ease-in-out shadow-none">
Clear
</p>
Expand All @@ -302,7 +302,7 @@
</p>
<div class="flex flex-row justify-end gap-4 mt-1">
<p
@click="removeRequest(vm, item.id)" class="btn px-3
@click.stop="removeRequest(vm, item.id)" class="btn px-3
rounded-xl active:scale-95 transition duration-150 ease-in-out shadow-none">
Clear
</p>
Expand All @@ -315,7 +315,7 @@
</p>
<div class="flex flex-row justify-end gap-4 mt-1">
<p
@click="removeRequest(vm, item.id)" class="btn px-3
@click.stop="removeRequest(vm, item.id)" class="btn px-3
rounded-xl active:scale-95 transition duration-150 ease-in-out shadow-none">
Clear
</p>
Expand All @@ -328,7 +328,7 @@
</p>
<div class="flex flex-row justify-end gap-4 mt-1">
<p
@click="removeRequest(vm, item.id)" class="btn px-3
@click.stop="removeRequest(vm, item.id)" class="btn px-3
rounded-xl active:scale-95 transition duration-150 ease-in-out shadow-none">
Clear
</p>
Expand Down
4 changes: 2 additions & 2 deletions app/main/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
import AutoImport from 'unplugin-auto-import/vite'
import { defineConfig } from 'vitest/config'
import path from 'path';
import path from 'path'

// See https://vitejs.dev/config/
export default defineConfig({
Expand All @@ -26,7 +26,7 @@ export default defineConfig({
fs: {
allow: [
// Resolve the path dynamically
path.resolve(__dirname, '../common/vue_lib/assets'),
path.resolve(__dirname, '../common/vue_lib'),
// Optionally, include other directories
path.resolve(__dirname)
]
Expand Down

0 comments on commit 614bcbc

Please # to comment.