Follow Enter/newline preferences for edits. Fixes #760. Fixes #770. Closes #771.

This commit is contained in:
Enrico Ros
2025-03-10 20:25:10 -07:00
parent b5eeb6945c
commit 926452bd55
@@ -4,6 +4,7 @@ import { BlocksTextarea } from '~/modules/blocks/BlocksContainers';
import type { ContentScaling } from '~/common/app.theme';
import type { DMessageFragmentId } from '~/common/stores/chat/chat.fragments';
import { Is } from '~/common/util/pwaUtils';
import { ShortcutKey, useGlobalShortcuts } from '~/common/components/shortcuts/useGlobalShortcuts';
import { useUIPreferencesStore } from '~/common/stores/store-ui';
@@ -12,9 +13,13 @@ import { useUIPreferencesStore } from '~/common/stores/store-ui';
/**
* Note: this will disable the galobal 'shift+enter' shortcut (and the status message) for this component as well.
* - #760. set to 'undefined' to follow the user preference
* - #760. Edit Mode not respecting Enter to Send
* - #770. inconsistent return / shift + return
* - #771. PR which was not merged (overly complex regex)
* set to 'undefined' to follow the user preference
* set to 'true' to force 'enter' to be a newline, which is best for mobile devices where 'shift+enter' is not possible
*/
const FORCE_ENTER_IS_NEWLINE = true;
const FORCE_ENTER_IS_NEWLINE = !Is.Desktop ? true : undefined;
const _textAreaSlotPropsEnter = {