File tree Expand file tree Collapse file tree
packages/app/src/pages/session Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -371,6 +371,12 @@ export function FileTabContent(props: { tab: string }) {
371371 } )
372372 }
373373
374+ const cancelCommenting = ( ) => {
375+ const p = path ( )
376+ if ( p ) file . setSelectedLines ( p , null )
377+ setNote ( "commenting" , null )
378+ }
379+
374380 createEffect (
375381 on (
376382 ( ) => state ( ) ?. loaded ,
@@ -484,7 +490,7 @@ export function FileTabContent(props: { tab: string }) {
484490 value = { note . draft }
485491 selection = { formatCommentLabel ( range ( ) ) }
486492 onInput = { ( value ) => setNote ( "draft" , value ) }
487- onCancel = { ( ) => setCommenting ( null ) }
493+ onCancel = { cancelCommenting }
488494 onSubmit = { ( value ) => {
489495 const p = path ( )
490496 if ( ! p ) return
@@ -498,7 +504,7 @@ export function FileTabContent(props: { tab: string }) {
498504
499505 setTimeout ( ( ) => {
500506 if ( ! document . activeElement || ! current . contains ( document . activeElement ) ) {
501- setCommenting ( null )
507+ cancelCommenting ( )
502508 }
503509 } , 0 )
504510 } }
You can’t perform that action at this time.
0 commit comments