|
@@ -99,7 +99,7 @@ const isDroppable = (fromPage?: Partial<IPageHasId>, newParentPage?: Partial<IPa
|
|
|
type NotDraggableProps = {
|
|
type NotDraggableProps = {
|
|
|
children: ReactNode,
|
|
children: ReactNode,
|
|
|
};
|
|
};
|
|
|
-const NotDraggable = (props: NotDraggableProps): JSX.Element => {
|
|
|
|
|
|
|
+const NotDraggableForClosableTextInput = (props: NotDraggableProps): JSX.Element => {
|
|
|
return <div draggable onDragStart={e => e.preventDefault()}>{props.children}</div>;
|
|
return <div draggable onDragStart={e => e.preventDefault()}>{props.children}</div>;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -449,15 +449,17 @@ const Item: FC<ItemProps> = (props: ItemProps) => {
|
|
|
</div>
|
|
</div>
|
|
|
{ isRenameInputShown
|
|
{ isRenameInputShown
|
|
|
? (
|
|
? (
|
|
|
- <NotDraggable>
|
|
|
|
|
- <ClosableTextInput
|
|
|
|
|
- value={nodePath.basename(page.path ?? '')}
|
|
|
|
|
- placeholder={t('Input page name')}
|
|
|
|
|
- onClickOutside={() => { setRenameInputShown(false) }}
|
|
|
|
|
- onPressEnter={onPressEnterForRenameHandler}
|
|
|
|
|
- inputValidator={inputValidator}
|
|
|
|
|
- />
|
|
|
|
|
- </NotDraggable>
|
|
|
|
|
|
|
+ <div className="d-block flex-fill">
|
|
|
|
|
+ <NotDraggableForClosableTextInput>
|
|
|
|
|
+ <ClosableTextInput
|
|
|
|
|
+ value={nodePath.basename(page.path ?? '')}
|
|
|
|
|
+ placeholder={t('Input page name')}
|
|
|
|
|
+ onClickOutside={() => { setRenameInputShown(false) }}
|
|
|
|
|
+ onPressEnter={onPressEnterForRenameHandler}
|
|
|
|
|
+ inputValidator={inputValidator}
|
|
|
|
|
+ />
|
|
|
|
|
+ </NotDraggableForClosableTextInput>
|
|
|
|
|
+ </div>
|
|
|
)
|
|
)
|
|
|
: (
|
|
: (
|
|
|
<>
|
|
<>
|
|
@@ -513,14 +515,16 @@ const Item: FC<ItemProps> = (props: ItemProps) => {
|
|
|
</li>
|
|
</li>
|
|
|
|
|
|
|
|
{isEnableActions && isNewPageInputShown && (
|
|
{isEnableActions && isNewPageInputShown && (
|
|
|
- <NotDraggable>
|
|
|
|
|
- <ClosableTextInput
|
|
|
|
|
- placeholder={t('Input page name')}
|
|
|
|
|
- onClickOutside={() => { setNewPageInputShown(false) }}
|
|
|
|
|
- onPressEnter={onPressEnterForCreateHandler}
|
|
|
|
|
- inputValidator={inputValidator}
|
|
|
|
|
- />
|
|
|
|
|
- </NotDraggable>
|
|
|
|
|
|
|
+ <div className="d-block flex-fill">
|
|
|
|
|
+ <NotDraggableForClosableTextInput>
|
|
|
|
|
+ <ClosableTextInput
|
|
|
|
|
+ placeholder={t('Input page name')}
|
|
|
|
|
+ onClickOutside={() => { setNewPageInputShown(false) }}
|
|
|
|
|
+ onPressEnter={onPressEnterForCreateHandler}
|
|
|
|
|
+ inputValidator={inputValidator}
|
|
|
|
|
+ />
|
|
|
|
|
+ </NotDraggableForClosableTextInput>
|
|
|
|
|
+ </div>
|
|
|
)}
|
|
)}
|
|
|
{
|
|
{
|
|
|
isOpen && hasChildren() && currentChildren.map((node, index) => (
|
|
isOpen && hasChildren() && currentChildren.map((node, index) => (
|