]> cat aescling's git repositories - mastodon.git/commitdiff
Fix crashes with Microsoft Translate on Microsoft Edge (#16525)
authorClaire <claire.github-309c@sitedethib.com>
Fri, 23 Jul 2021 00:53:17 +0000 (02:53 +0200)
committerGitHub <noreply@github.com>
Fri, 23 Jul 2021 00:53:17 +0000 (02:53 +0200)
Fixes #16509

Microsoft Edge with translation enabled rewrites the DOM in ways that confuse
react and prevent it from working properly. Wrapping the offending parts in
a span avoids this issue.

app/javascript/mastodon/components/status.js

index 295e83f5819607cf5ada9250c30741d2e9fdb9b8..ccc9067d1240073a013f70f3ba13f2f2e2dd36ab 100644 (file)
@@ -309,8 +309,8 @@ class Status extends ImmutablePureComponent {
       return (
         <HotKeys handlers={handlers}>
           <div ref={this.handleRef} className={classNames('status__wrapper', { focusable: !this.props.muted })} tabIndex='0'>
-            {status.getIn(['account', 'display_name']) || status.getIn(['account', 'username'])}
-            {status.get('content')}
+            <span>{status.getIn(['account', 'display_name']) || status.getIn(['account', 'username'])}</span>
+            <span>{status.get('content')}</span>
           </div>
         </HotKeys>
       );