44 aTimeout ,
55 enter ,
66 escKeyDown ,
7+ fire ,
78 fixtureSync ,
89 focusin ,
910 focusout ,
@@ -12,6 +13,7 @@ import {
1213 nextRender ,
1314 tabKeyDown ,
1415} from '@vaadin/testing-helpers' ;
16+ import { sendKeys } from '@web/test-runner-commands' ;
1517import sinon from 'sinon' ;
1618import '@vaadin/grid/vaadin-grid.js' ;
1719import '@vaadin/tooltip/vaadin-tooltip.js' ;
@@ -209,6 +211,39 @@ describe('tooltip', () => {
209211 expect ( tooltip . opened ) . to . be . false ;
210212 } ) ;
211213
214+ it ( 'should hide the tooltip when starting scrolling' , async ( ) => {
215+ const cell = getCell ( grid , 0 ) ;
216+ mouseenter ( cell ) ;
217+
218+ fire ( grid . $ . table , 'scroll' ) ;
219+ await nextFrame ( ) ;
220+
221+ expect ( tooltip . opened ) . to . be . false ;
222+ } ) ;
223+
224+ it ( 'should not hide the tooltip when scrolling using keyboard navigation' , async ( ) => {
225+ const cell = getCell ( grid , 0 ) ;
226+ tabKeyDown ( document . body ) ;
227+ focusin ( cell ) ;
228+ expect ( tooltip . opened ) . to . be . true ;
229+
230+ await sendKeys ( { press : 'ArrowDown' } ) ;
231+ fire ( grid . $ . table , 'scroll' ) ;
232+ await nextFrame ( ) ;
233+
234+ expect ( tooltip . opened ) . to . be . true ;
235+ } ) ;
236+
237+ it ( 'should not show the tooltip on mouseenter while scrolling' , async ( ) => {
238+ fire ( grid . $ . table , 'scroll' ) ;
239+ await nextFrame ( ) ;
240+
241+ const cell = getCell ( grid , 0 ) ;
242+ mouseenter ( cell ) ;
243+
244+ expect ( tooltip . opened ) . to . be . false ;
245+ } ) ;
246+
212247 it ( 'should not set tooltip target if there is no tooltip' , async ( ) => {
213248 const spy = sinon . spy ( grid . _tooltipController , 'setTarget' ) ;
214249
0 commit comments