diff --git a/packages/hash/frontend/src/blocks/page/BlockContextMenu/BlockContextMenuItem.tsx b/packages/hash/frontend/src/blocks/page/BlockContextMenu/BlockContextMenuItem.tsx index 6fa0e4ef67f..2f2e5c85d9c 100644 --- a/packages/hash/frontend/src/blocks/page/BlockContextMenu/BlockContextMenuItem.tsx +++ b/packages/hash/frontend/src/blocks/page/BlockContextMenu/BlockContextMenuItem.tsx @@ -38,9 +38,9 @@ export const BlockContextMenuItem = forwardRef< number | undefined >(); const localRef = useRef(null); - // @todo this doesn't handle when ref is a function and can break when trying to - // access offsetTop in the useLayoutEffect. Consider using an library to handle merging refs - // @see https://github.com/gregberge/react-merge-refs, or better still, use the + // @todo this doesn't handle when ref is a function and can break when trying to + // access offsetTop in the useLayoutEffect. Consider using an library to handle merging refs + // @see https://github.com/gregberge/react-merge-refs, or better still, use the // useForkRef exported by MUI const menuItemRef = (ref ?? localRef) as RefObject; diff --git a/packages/hash/frontend/src/blocks/page/BlockContextMenu/BlockListMenuContent.tsx b/packages/hash/frontend/src/blocks/page/BlockContextMenu/BlockListMenuContent.tsx index 99fc29330eb..ee48e222be2 100644 --- a/packages/hash/frontend/src/blocks/page/BlockContextMenu/BlockListMenuContent.tsx +++ b/packages/hash/frontend/src/blocks/page/BlockContextMenu/BlockListMenuContent.tsx @@ -11,9 +11,7 @@ import { } from "@mui/material"; import { PopupState } from "material-ui-popup-state/core"; import { useRef, useState, VFC } from "react"; -import { - BlockSuggesterProps -} from "../createSuggester/BlockSuggester"; +import { BlockSuggesterProps } from "../createSuggester/BlockSuggester"; import { useFilteredBlocks } from "../createSuggester/useFilteredBlocks"; import { useUserBlocks } from "../../userBlocks"; import { FontAwesomeIcon } from "../../../shared/icons"; @@ -32,20 +30,19 @@ export const BlockListMenuContent: VFC = ({ const { value: userBlocks } = useUserBlocks(); const blocks = useFilteredBlocks(searchQuery, userBlocks); - - // The essence of this is to autoFocus the input when - // the blocklist menu comes up. We have a listener for - // character "/". Once that is clicked the MenuItem that has this submenu - // is focused and as a result the submenu becomes visible. - // Currently this flow introduces a bug where it is difficult to switch to certain blocks - // e.g Embed; - // @see https://github.com/hashintel/hash/pull/480#discussion_r849594184 - // Commenting this out till a fix is made - // useEffect(() => { - // if (popupState?.isOpen) { - // searchInputRef.current?.focus(); - // } - // }, [popupState]); + // The essence of this is to autoFocus the input when + // the blocklist menu comes up. We have a listener for + // character "/". Once that is clicked the MenuItem that has this submenu + // is focused and as a result the submenu becomes visible. + // Currently this flow introduces a bug where it is difficult to switch to certain blocks + // e.g Embed; + // @see https://github.com/hashintel/hash/pull/480#discussion_r849594184 + // Commenting this out till a fix is made + // useEffect(() => { + // if (popupState?.isOpen) { + // searchInputRef.current?.focus(); + // } + // }, [popupState]); return ( @@ -88,7 +85,7 @@ export const BlockListMenuContent: VFC = ({ { blockSuggesterProps.onChange(option.variant, option.meta); - popupState?.close() + popupState?.close(); }} key={`${option.meta.name}/${option.variant.name}`} > diff --git a/packages/hash/frontend/src/blocks/page/BlockContextMenu/LoadEntityMenuContent.tsx b/packages/hash/frontend/src/blocks/page/BlockContextMenu/LoadEntityMenuContent.tsx index fb16be34f46..86c66f4ef8e 100644 --- a/packages/hash/frontend/src/blocks/page/BlockContextMenu/LoadEntityMenuContent.tsx +++ b/packages/hash/frontend/src/blocks/page/BlockContextMenu/LoadEntityMenuContent.tsx @@ -32,7 +32,7 @@ export const LoadEntityMenuContent: VFC = ({ // This depends on state external to react without subscribing to it // and this can cause some bugs. // @todo make this a subscription - const entityStore = entityStorePluginState(blockView.view.state).store + const entityStore = entityStorePluginState(blockView.view.state).store; const blockData = entityId ? entityStore.saved[entityId] : null; const searchInputRef = useRef(null); const { data: entities, loading } = useAccountEntities({ diff --git a/packages/hash/shared/src/ProsemirrorSchemaManager.ts b/packages/hash/shared/src/ProsemirrorSchemaManager.ts index c96bbf8ad15..6075cb51cbc 100644 --- a/packages/hash/shared/src/ProsemirrorSchemaManager.ts +++ b/packages/hash/shared/src/ProsemirrorSchemaManager.ts @@ -268,7 +268,7 @@ export class ProsemirrorSchemaManager { * This assumes the block info has been fetched and the * entities (block entity and child entity) * @todo this only works for non-text blocks, - * It should be updated to handle text blocks when + * It should be updated to handle text blocks when * https://github.com/hashintel/hash/pull/490 is in */ createLocalBlock({ @@ -347,7 +347,7 @@ export class ProsemirrorSchemaManager { * 3. [Outermost] The block node (rendered by BlockView) which * provides the surrounding UI */ - return this.schema.nodes.block!.create({}, [ + return this.schema.nodes.block!.create({}, [ this.schema.nodes.entity!.create({ draftId: draftBlockId }, [ this.schema.nodes.entity!.create( {