Skip to content

Commit

Permalink
Make suggestion clickable in bookmark creation
Browse files Browse the repository at this point in the history
This was especially noticeable when using the web app on mobile devices
as the suggestion looks like it's clickable. It should be also a little
bit more convenient UX-wise when it's allowed to be clicked in non-
mobile context as well.
  • Loading branch information
cbe committed Oct 22, 2023
1 parent 03df5e8 commit 047b860
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions internal/view/assets/js/component/dialog.js
Expand Up @@ -31,9 +31,10 @@ var template = `
@focus="$event.target.select()"
@keyup="handleInput(index)"
@keyup.enter="handleInputEnter(index)">
<span :ref="'suggestion-'+index"
v-if="field.suggestion"
class="suggestion">{{field.suggestion}}</span>
<button :ref="'suggestion-'+index"
v-if="field.suggestion"
@click="handleInputEnter(index)"
class="suggestion">{{field.suggestion}}</button>
</template>
</slot>
</div>
Expand Down Expand Up @@ -191,11 +192,11 @@ export default {
// Display suggestion
this.$nextTick(() => {
var input = this.$refs.input[index],
span = this.$refs['suggestion-' + index][0],
suggestionNode = this.$refs['suggestion-' + index][0],
inputRect = input.getBoundingClientRect();

span.style.top = (inputRect.bottom - 1) + 'px';
span.style.left = inputRect.left + 'px';
suggestionNode.style.top = (inputRect.bottom - 1) + 'px';
suggestionNode.style.left = inputRect.left + 'px';
});
},
handleInputEnter(index) {
Expand Down Expand Up @@ -235,4 +236,4 @@ export default {
})
}
}
}
}

0 comments on commit 047b860

Please sign in to comment.