FIX: Allow pasting invitees in invite modal (#12520)

FIX: Allow pasting invitees in invite modal (#12520)

Meta topic: Pasting email in share a thread box stopped working - bug - Discourse Meta.

diff --git a/app/assets/javascripts/discourse/app/components/invite-panel.js b/app/assets/javascripts/discourse/app/components/invite-panel.js
index 89cb29b..7a77a6d 100644
--- a/app/assets/javascripts/discourse/app/components/invite-panel.js
+++ b/app/assets/javascripts/discourse/app/components/invite-panel.js
@@ -468,7 +468,11 @@ export default Component.extend({
 
   @action
   updateInvitee(selected, content) {
-    const invitee = content.findBy("id", selected[0]);
+    let invitee = content.findBy("id", selected[0]);
+    if (!invitee && content.length) {
+      invitee =
+        typeof content[0] === "string" ? { id: content[0] } : content[0];
+    }
     if (invitee) {
       this.setProperties({
         invitee: invitee.id.trim(),
diff --git a/app/assets/javascripts/discourse/app/templates/components/invite-panel.hbs b/app/assets/javascripts/discourse/app/templates/components/invite-panel.hbs
index 95b360d..d5cfd1e 100644
--- a/app/assets/javascripts/discourse/app/templates/components/invite-panel.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/invite-panel.hbs
@@ -28,6 +28,7 @@
               excludeCurrentUser=true
               includeMessageableGroups=isPM
               filterPlaceholder=placeholderKey
+              fullWidthWrap=true
             )
           }}
         {{else}}
diff --git a/app/assets/stylesheets/common/components/share-and-invite-modal.scss b/app/assets/stylesheets/common/components/share-and-invite-modal.scss
index 20fc011..ff164ee 100644
--- a/app/assets/stylesheets/common/components/share-and-invite-modal.scss
+++ b/app/assets/stylesheets/common/components/share-and-invite-modal.scss
@@ -76,10 +76,6 @@
       margin-bottom: 8px;
     }
 
-    .invite-user-control input.email-or-username-input {
-      line-height: 1.75em;
-    }
-
     .group-access-control {
       .select-kit.multi-select input.filter-input {
         padding-left: 8px;
@@ -98,8 +94,16 @@
       color: var(--secondary-medium);
     }
 
-    .email-or-username-input {
+    .invite-user-input {
       width: 100%;
+
+      .input-wrapper {
+        width: 100%;
+
+        .filter-input {
+          width: 100%;
+        }
+      }
     }
 
     .max-redemptions-allowed {

GitHub sha: c0287454

This commit appears in #12520 which was approved by eviltrout. It was merged by OsamaSayegh.