Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const NodeSelectionKeyboardExtension = createExtension(
// Checks if key press is Enter
if (
event.key === "Enter" &&
!event.isComposing &&
!event.shiftKey &&
!event.altKey &&
!event.ctrlKey &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const EmbedTab = <

const handleURLEnter = useCallback(
(event: KeyboardEvent) => {
if (event.key === "Enter") {
if (event.key === "Enter" && !event.nativeEvent.isComposing) {
event.preventDefault();
editor.updateBlock(block.id, {
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ export const FileCaptionButton = () => {
editorHasBlockWithType(editor, block.type, {
caption: "string",
}) &&
event.key === "Enter"
event.key === "Enter" &&
!event.nativeEvent.isComposing
) {
event.preventDefault();
editor.updateBlock(block.id, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export const FileRenameButton = () => {
editorHasBlockWithType(editor, block.type, {
name: "string",
}) &&
event.key === "Enter"
event.key === "Enter" &&
!event.nativeEvent.isComposing
) {
event.preventDefault();
editor.updateBlock(block.id, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const EditLinkMenuItems = (

const handleEnter = useCallback(
(event: KeyboardEvent) => {
if (event.key === "Enter") {
if (event.key === "Enter" && !event.nativeEvent.isComposing) {
event.preventDefault();
editLink(validateUrl(currentUrl), currentText, props.range.from);
props.setToolbarOpen?.(false);
Expand Down
4 changes: 2 additions & 2 deletions packages/xl-ai/src/components/AIMenu/PromptSuggestionMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const PromptSuggestionMenu = (props: PromptSuggestionMenuProps) => {

const handleEnter = useCallback(
async (event: KeyboardEvent) => {
if (event.key === "Enter") {
if (event.key === "Enter" && !event.nativeEvent.isComposing) {
// console.log("ENTER", currentEditingPrompt);
onManualPromptSubmit(promptTextToUse);
}
Expand Down Expand Up @@ -71,7 +71,7 @@ export const PromptSuggestionMenu = (props: PromptSuggestionMenuProps) => {
const handleKeyDown = useCallback(
(event: KeyboardEvent) => {
// TODO: handle backspace to close
if (event.key === "Enter") {
if (event.key === "Enter" && !event.nativeEvent.isComposing) {
if (items.length > 0) {
handler(event);
} else {
Expand Down
Loading