@@ -49,8 +49,9 @@ const OverarchingGoalComponent: React.FC<{
49
49
< div className = "flex items-center justify-between px-4" >
50
50
< div
51
51
className = { cn (
52
- "relative h-8 w-full justify-start rounded-[0.5rem] bg-muted hover:bg-gray-200 text-sm font-semibold text-muted-foreground shadow-inner flex items-center px-3 "
52
+ "relative h-8 w-full justify-start rounded-[0.5rem] bg-muted hover:bg-gray-200 text-sm font-semibold text-muted-foreground shadow-inner flex items-center pl-0 pr-2 "
53
53
) }
54
+ onClick = { toggleDrawer }
54
55
>
55
56
< div className = "flex items-center justify-between w-full" >
56
57
< div id = "label" className = "flex w-full mr-2 min-w-0" >
@@ -59,16 +60,24 @@ const OverarchingGoalComponent: React.FC<{
59
60
value = { tempGoalTitle }
60
61
onChange = { ( e ) => setTempGoalTitle ( e . target . value ) }
61
62
onKeyDown = { ( e ) => e . key === "Enter" && handleSetGoal ( ) }
62
- className = { cn ( "w-full h-6 bg-inherit border-0 p-1" ) }
63
+ onClick = { ( e ) => e . stopPropagation ( ) } // Ensure clicking the input component does not call toggleDrawer
64
+ className = { cn ( "w-full h-6 bg-inherit border-0 px-2 py-1" ) }
63
65
placeholder = "Insert a new overarching goal"
64
66
/>
65
67
) : (
66
- < div >
68
+ /* Ensure that clicking the overarching goal text (e.g. if the user wants to highlight the text)
69
+ does not call toggleDrawer */
70
+ < div className = "ml-2 mr-2" >
67
71
< span className = "hidden md:inline-flex truncate" >
68
72
< div className = "mr-1" > { "Overarching goal: " } </ div >
69
- < div > { overarchingGoal . title } </ div >
73
+ < div onClick = { ( e ) => e . stopPropagation ( ) } >
74
+ { overarchingGoal . title }
75
+ </ div >
70
76
</ span >
71
- < span className = "inline-flex md:hidden" >
77
+ < span
78
+ className = "inline-flex md:hidden"
79
+ onClick = { ( e ) => e . stopPropagation ( ) }
80
+ >
72
81
{ overarchingGoal . title }
73
82
</ span >
74
83
</ div >
0 commit comments