diff --git a/app/assets/javascripts/discourse/app/components/share-popup.js b/app/assets/javascripts/discourse/app/components/share-popup.js index a2d9decc137..85e815ce507 100644 --- a/app/assets/javascripts/discourse/app/components/share-popup.js +++ b/app/assets/javascripts/discourse/app/components/share-popup.js @@ -49,8 +49,11 @@ export default Component.extend({ if (this.element) { const linkInput = this.element.querySelector("#share-link input"); linkInput.value = this.link; - linkInput.setSelectionRange(0, this.link.length); - linkInput.focus(); + if (!this.site.mobileView) { + // if the input is auto-focused on mobile, iOS requires two taps of the copy button + linkInput.setSelectionRange(0, this.link.length); + linkInput.focus(); + } } }, 200); }, diff --git a/app/assets/javascripts/discourse/app/templates/components/share-popup.hbs b/app/assets/javascripts/discourse/app/templates/components/share-popup.hbs index 695be0aeb58..23e32ea4200 100644 --- a/app/assets/javascripts/discourse/app/templates/components/share-popup.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/share-popup.hbs @@ -4,13 +4,21 @@ {{#if date}} {{displayDate}} {{/if}} + + {{d-button + action=(action "close") + class="btn btn-flat close" + icon="times" + aria-label="share.close" + title="share.close" + }} -
- + -
+