Skip to content

Commit

Permalink
fix: option clicks skip the next line
Browse files Browse the repository at this point in the history
  • Loading branch information
gudzpoz committed Oct 31, 2023
1 parent 752f0c8 commit 88021a2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/StoryScene.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ function emitClick(event: MouseEvent) {
if (props.options.length > 0) {
return;
}
if ((event.target as HTMLElement).nodeName === 'BUTTON') {
return;
}
const dx = clickX - event.clientX;
const dy = clickY - event.clientY;
const distance = dx * dx + dy * dy;
Expand Down Expand Up @@ -120,7 +123,7 @@ watch(() => props.history, (history) => {
</sprite-image-view>
</transition-group>
<div class="options" v-show="options.length > 0 && !history">
<button v-html="option.option" v-for="option in options" :key="option.option.text"
<button v-html="option.option.text" v-for="option in options" :key="option.option.text"
@click="emit('choose', option.key)"
>
</button>
Expand Down Expand Up @@ -232,8 +235,9 @@ watch(() => props.history, (history) => {
position: relative;
display: block;
margin: 5px;
padding: 0.8em;
line-height: 1em;
width: 75vw;
width: 75%;
max-width: 42em;
background-color: #0006;
color: white;
Expand Down

0 comments on commit 88021a2

Please sign in to comment.