Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp
533 B
Raw Blame
// SPDX-License-Identifier: AGPL-3.0-or-later

import {ComponentBus} from '@app/features/platform/utils/ComponentBus';

export function focusChannelTextareaAfterNavigation(channelId: string): void {
	const requestFocus = () => {
		ComponentBus.dispatch('FOCUS_TEXTAREA', {channelId});
	};
	window.requestAnimationFrame(requestFocus);
	window.setTimeout(requestFocus, 300);
}

export function focusChannelTextareaFromKeybind(channelId: string): void {
	ComponentBus.dispatch('FOCUS_TEXTAREA', {channelId, enterKeyboardMode: true});
}