File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ function ControlInput({ type }: Props): ReactElement {
23
23
24
24
const onClick = ( e : React . MouseEvent < HTMLDivElement > ) => {
25
25
e . preventDefault ( )
26
- onComplete ( )
26
+ if ( ( e . target as any ) . tagName !== 'INPUT' ) {
27
+ onComplete ( )
28
+ }
27
29
28
30
if ( title ) {
29
31
dispatchEvent ( )
@@ -78,6 +80,7 @@ function ControlInput({ type }: Props): ReactElement {
78
80
</ span >
79
81
< input
80
82
className = { cn (
83
+ 'nextra-add-contents-input' ,
81
84
'focus-visible:box-shadow-none nx-ml-1 nx-w-full nx-px-1 nx-py-0.5' ,
82
85
'nx-bg-gray-100 nx-text-gray-600 ' ,
83
86
'dark:nx-bg-primary-100/5 dark:nx-text-gray-400' ,
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export const SortableItem = forwardRef<HTMLDivElement, SortableItemProps>((props
71
71
isSeparator && 'nx-cursor-default' ,
72
72
isSeparator ? classes . separator : classes . link ,
73
73
active ? classes . active : classes . inactive ,
74
- ! isDragging && ! active && classes . inactiveBgColor ,
74
+ ! isControlAction && ! isDragging && ! active && classes . inactiveBgColor ,
75
75
isGhost && classes . ghost ,
76
76
clone && classes . clone ,
77
77
isControlAction && '!nx-pr-0' ,
Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ export const classes = {
10
10
'contrast-more:nx-border-primary-500 contrast-more:dark:nx-border-primary-500' ,
11
11
) ,
12
12
inactive : cn (
13
- 'nx-text-gray-500' ,
14
- 'dark:nx-text-neutral-400 dark:hover:nx-bg-primary-100/5 dark:hover:nx-text-gray-50' ,
13
+ 'nx-text-gray-500 dark:nx-text-neutral-400' ,
15
14
'contrast-more:nx-text-gray-900 contrast-more:dark:nx-text-gray-50' ,
16
15
'contrast-more:nx-border-transparent contrast-more:hover:nx-border-gray-900 contrast-more:dark:hover:nx-border-gray-50' ,
17
16
) ,
Original file line number Diff line number Diff line change 1
1
import { useEffect , useRef } from 'react'
2
2
3
- export default function useOutsideClick < T extends Element > ( callback : ( ) => any ) {
3
+ export default function useOutsideClick < T extends Element > ( callback : ( event ?: MouseEvent ) => any ) {
4
4
const ref = useRef < T > ( null )
5
5
6
6
useEffect ( ( ) => {
7
7
const handleClick = ( event : MouseEvent ) => {
8
8
if ( ref . current && ! ref . current . contains ( event . target as any ) ) {
9
- callback ( )
9
+ callback ( event )
10
10
}
11
11
}
12
12
You can’t perform that action at this time.
0 commit comments