FIX: Buggy jump-to-post on Firefox (#16153)

This commit is contained in:
Penar Musaraj 2022-03-10 20:39:39 +01:00 committed by GitHub
parent 8d96761a4f
commit 3a817d2377
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -158,6 +158,7 @@ export default Component.extend({
} }
if (event.key === "Enter" && this.triggerClickOnEnter(event)) { if (event.key === "Enter" && this.triggerClickOnEnter(event)) {
this.element?.querySelector(".modal-footer .btn-primary")?.click(); this.element?.querySelector(".modal-footer .btn-primary")?.click();
event.preventDefault();
} }
if (event.key === "Tab") { if (event.key === "Tab") {
this._trapTab(event); this._trapTab(event);

View File

@ -3,7 +3,13 @@
<div class="jump-to-post-form"> <div class="jump-to-post-form">
<div class="jump-to-post-control"> <div class="jump-to-post-control">
<span class="index">#</span> <span class="index">#</span>
{{input id="post-jump" type="number" value=postNumber insert-newline=(action "jump")}} {{input
id="post-jump"
type="number"
value=postNumber
insert-newline=(action "jump")
autofocus="true"
}}
<span class="input-hint-text post-number"> <span class="input-hint-text post-number">
{{i18n "topic.progress.jump_prompt_of" count=filteredPostsCount}} {{i18n "topic.progress.jump_prompt_of" count=filteredPostsCount}}
</span> </span>