Skip to content

Composer loses focus after typing emoji #7472

Closed
@dbkr

Description

@dbkr

...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);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1S-MinorImpairs non-critical functionality or suitable workarounds existT-Defect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions