Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inserting emoji using OS X character picker causes composer to lose focus #7218

Closed
dbkr opened this issue Aug 24, 2018 · 8 comments
Closed
Labels
P1 S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-Platform-Specific Z-Upstream

Comments

@dbkr
Copy link
Member

dbkr commented Aug 24, 2018

Press ctrl+cmd+space to bring up the character picker, insert any character. Message composer loses the focus.

@lampholder
Copy link
Member

天啊现在我的电脑说的中文。

That's better. Despite messing up the keyboard chording and somehow switching input to Chinese, I didn't experience this issue with the mac character picker. I'm on High Sierra 10.13.6 (17G65) and Riot Electron 0.16.

Either clicking or using the keyboard, both left the cursor in the composer.

@aaronraimist
Copy link
Collaborator

@lampholder I can reproduce this in Chrome. In Safari, it loses focus and doesn't even type the emoji (if it is the first character) on /develop. Possibly related to updating slate?

@dbkr
Copy link
Member Author

dbkr commented Oct 11, 2018

#7472 has some diagnosis on this (I failed to find the original bug I filed). It happened for me both before an and after updating slate.

@dbkr dbkr changed the title Using OS X character picker causes composer to lose focus Inserting emoji using OS X character picker causes composer to lose focus Oct 11, 2018
@lampholder
Copy link
Member

Gnh, I can now repro this on Electron and on Chrome, and I've noticed something else on Firefox - following the same repro steps you get two emoji in the composer, a native one and a emojione one.

@lampholder lampholder added ui/ux P1 S-Minor Impairs non-critical functionality or suitable workarounds exist and removed X-Cannot-Reproduce labels Oct 11, 2018
@lampholder
Copy link
Member

Useful stuff from @dbkr's second filing of this bug (#7472):

Composer loses focus after typing emoji ...if it's the first character you type in the composer.

I'm using the OS X emoji picker here: unsure if there's a way to repro it on other platforms. Focus composer, ctrl+cmd+space, pick an emoji, emoji goes into composer, press another letter, nothing happens. If you press space, you get a space and can carry on typing.

Having looked into this a little, the selection in the DOM is moving to the sticker button in the time between the composer's componentDidUpdate and a setTimeout(,0) in componentDidUpdate.

componentDidUpdate() {
        console.log("i dun updated");
        const s = window.getSelection();
        console.log("selection anchor: ", s.anchorNode); // <-- prints the last text node in composer
        setTimeout(function() {
            console.log("selection anchor: ", s.anchorNode); <-- prints sticker button
        }, 0);
    }

More interestingly, I can repro this on the slatejs.org examples if I edit the HTML to put <div>hello</div> right after the content-editable div.

Edit: and conversely, if I remove everything after the composer in Riot (ie. the composer buttons and the members panel) I don't get the bug.

@ara4n
Copy link
Member

ara4n commented Oct 11, 2018

i got bitten by this on Chrome (for the first time) today, since the upgrade to 0.41.

@dbkr
Copy link
Member Author

dbkr commented Oct 11, 2018

ianstormtaylor/slate#2251 filed upstream

@turt2live turt2live self-assigned this Oct 31, 2018
@turt2live turt2live removed their assignment Nov 5, 2018
@turt2live
Copy link
Member

Closing in favour of #7665 to track the upstream issue.

su-ex added a commit to SchildiChat/element-web that referenced this issue Dec 7, 2021
* Add unread indicator to the timelineCard header icon ([\element-hq#7156](matrix-org/matrix-react-sdk#7156)). Fixes element-hq#19635.
* Only show core navigation elements (call/chat/notification/info) when a widget is maximised ([\element-hq#7114](matrix-org/matrix-react-sdk#7114)). Fixes element-hq#19632.
* Improve ThreadPanel ctx menu accessibility ([\element-hq#7217](matrix-org/matrix-react-sdk#7217)). Fixes element-hq#19885.
* Allow filtering room list during treeview navigation ([\element-hq#7219](matrix-org/matrix-react-sdk#7219)). Fixes element-hq#14702.
* Add right panel chat timeline ([\element-hq#7112](matrix-org/matrix-react-sdk#7112)). Fixes element-hq#19633.
* Hide server options hint when disable_custom_urls is true ([\element-hq#7215](matrix-org/matrix-react-sdk#7215)). Fixes element-hq#19919.
* Improve right panel resize handle usability ([\element-hq#7204](matrix-org/matrix-react-sdk#7204)). Fixes element-hq#15145. Contributed by @weeman1337.
* Spaces quick settings ([\element-hq#7196](matrix-org/matrix-react-sdk#7196)).
* Maximised widgets always force a call to be shown in PIP mode ([\element-hq#7163](matrix-org/matrix-react-sdk#7163)). Fixes element-hq#19637.
* Group Labs flags ([\#7190](matrix-org/matrix-react-sdk#7190)).
* Show room context details in forward dialog ([\element-hq#7162](matrix-org/matrix-react-sdk#7162)). Fixes element-hq#19793.
* Remove chevrons from RoomSummaryCard_Button ([\element-hq#7137](matrix-org/matrix-react-sdk#7137)). Fixes element-hq#19644.
* Disable op/deop commands where user has no permissions ([\element-hq#7161](matrix-org/matrix-react-sdk#7161)). Fixes element-hq#15390.
* Add option to change the size of images/videos in the timeline ([\element-hq#7017](matrix-org/matrix-react-sdk#7017)). Fixes element-hq/element-meta#49 element-hq#1520 and element-hq#19498.
* Fix left panel glow in Safari ([\element-hq#7236](matrix-org/matrix-react-sdk#7236)). Fixes element-hq#19863.
* Fix newline on edit messages with quotes ([\element-hq#7227](matrix-org/matrix-react-sdk#7227)). Fixes element-hq#12535. Contributed by @renancleyson-dev.
* Guard against null refs in findSiblingElement ([\#7228](matrix-org/matrix-react-sdk#7228)).
* Tweak bottom of space panel buttons in expanded state ([\element-hq#7213](matrix-org/matrix-react-sdk#7213)). Fixes element-hq#19921.
* Fix multiline paragraph rendering as single line ([\element-hq#7210](matrix-org/matrix-react-sdk#7210)). Fixes element-hq#8786. Contributed by @renancleyson-dev.
* Improve room list message previews ([\element-hq#7224](matrix-org/matrix-react-sdk#7224)). Fixes element-hq#17101 and element-hq#16169.
* Fix EmojiPicker lazy loaded rendering bug ([\element-hq#7225](matrix-org/matrix-react-sdk#7225)). Fixes element-hq#15341.
* Prevent default avatar in UserInfo having pointer cursor ([\element-hq#7218](matrix-org/matrix-react-sdk#7218)). Fixes element-hq#13872.
* Prevent duplicate avatars in Event List Summaries ([\element-hq#7222](matrix-org/matrix-react-sdk#7222)). Fixes element-hq#17706.
* Respect the home page as a context for the Home space ([\element-hq#7216](matrix-org/matrix-react-sdk#7216)). Fixes element-hq#19554.
* Fix RoomUpgradeWarningBar exploding ([\element-hq#7214](matrix-org/matrix-react-sdk#7214)). Fixes element-hq#19920.
* Polish threads misalignments and UI diversion ([\element-hq#7209](matrix-org/matrix-react-sdk#7209)). Fixes element-hq#19772, element-hq#19710 element-hq#19629 and element-hq#19711.
* Fix Manage Restricted Join Rule Dialog for Spaces ([\element-hq#7208](matrix-org/matrix-react-sdk#7208)). Fixes element-hq#19610.
* Fix wrongly showing unpin in pinned messages tile with no perms ([\element-hq#7197](matrix-org/matrix-react-sdk#7197)). Fixes element-hq#19886.
* Make image size constrained by height when using the ImageSize.Large option ([\element-hq#7171](matrix-org/matrix-react-sdk#7171)). Fixes element-hq#19788.
* Prevent programmatic scrolling within truncated room sublists ([\element-hq#7191](matrix-org/matrix-react-sdk#7191)).
* Remove leading slash from /addwidget Jitsi confs ([\element-hq#7175](matrix-org/matrix-react-sdk#7175)). Fixes element-hq#19839. Contributed by @AndrewFerr.
* Fix automatic composer focus, regressed by threads work ([\element-hq#7167](matrix-org/matrix-react-sdk#7167)). Fixes element-hq#19479.
* Show space members when not invited even if summary didn't fail ([\element-hq#7153](matrix-org/matrix-react-sdk#7153)). Fixes element-hq#19781.
* Prevent custom power levels from breaking roles & permissions tab ([\element-hq#7160](matrix-org/matrix-react-sdk#7160)). Fixes element-hq#19812.
* Room Context Menu should respond to tag changes ([\element-hq#7154](matrix-org/matrix-react-sdk#7154)). Fixes element-hq#19776.
* Fix an edge case when trying to join an upgraded room ([\element-hq#7159](matrix-org/matrix-react-sdk#7159)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-Platform-Specific Z-Upstream
Projects
None yet
Development

No branches or pull requests

5 participants