File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed
Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -699,5 +699,42 @@ describe("Comment", () => {
699699 } )
700700 ) ;
701701 } ) ;
702+
703+ it ( "must check that the focus is moved on the editor once the popup is deleted" , async ( ) => {
704+ await Promise . all (
705+ pages . map ( async ( [ , page ] ) => {
706+ await switchToHighlight ( page ) ;
707+
708+ await highlightSpan ( page , 1 , "Abstract" ) ;
709+ const editorSelector = getEditorSelector ( 0 ) ;
710+ await editComment ( page , editorSelector , "Hello world!" ) ;
711+
712+ await waitAndClick (
713+ page ,
714+ `${ editorSelector } button.annotationCommentButton`
715+ ) ;
716+
717+ const popupSelector = "#commentPopup" ;
718+ await page . waitForSelector ( popupSelector , { visible : true } ) ;
719+ const handle = await page . evaluateHandle (
720+ sel => [
721+ new Promise ( resolve => {
722+ document
723+ . querySelector ( sel )
724+ . addEventListener ( "focusin" , resolve , {
725+ once : true ,
726+ } ) ;
727+ } ) ,
728+ ] ,
729+ editorSelector
730+ ) ;
731+ await waitAndClick (
732+ page ,
733+ `${ popupSelector } button.commentPopupDelete`
734+ ) ;
735+ await awaitPromise ( handle ) ;
736+ } )
737+ ) ;
738+ } ) ;
702739 } ) ;
703740} ) ;
Original file line number Diff line number Diff line change @@ -1048,6 +1048,7 @@ class CommentPopup {
10481048 } ,
10491049 } ) ;
10501050 this . #editor. comment = null ;
1051+ this . #editor. focus ( ) ;
10511052 this . destroy ( ) ;
10521053 } ) ;
10531054 del . addEventListener ( "contextmenu" , noContextMenu ) ;
You can’t perform that action at this time.
0 commit comments