@@ -191,8 +191,6 @@ class Datepicker extends BaseComponent {
191191 this . _themeObserver = null
192192 }
193193
194- // The focus listener lives on `document`, so `BaseComponent.dispose()`, which
195- // only clears listeners on `this._element`, cannot remove it.
196194 if ( this . _onFocusIn ) {
197195 EventHandler . off ( document , EVENT_FOCUSIN , this . _onFocusIn )
198196 }
@@ -354,11 +352,7 @@ class Datepicker extends BaseComponent {
354352 } )
355353 }
356354
357- // Vanilla Calendar Pro closes the popup on an outside click and on Escape, but
358- // it ignores focus. It also mounts the popup on `<body>`, not inside the
359- // trigger, so a listener on the trigger never sees focus leave the calendar.
360- // Watch focus on the document instead, and close when focus lands outside both
361- // the trigger and the calendar.
355+ // VCP ignores focus and mounts the popup on `<body>`.
362356 protected _setupDismissOnFocus ( ) : void {
363357 if ( this . _isInline ) {
364358 return
@@ -372,9 +366,6 @@ class Datepicker extends BaseComponent {
372366 const { target } = event
373367 const mainElement = this . _calendar ?. context ?. mainElement
374368
375- // Focus stayed on the trigger or moved into the calendar popup. A focusin
376- // only fires when focus actually moves, so a click on the calendar's own
377- // padding raises no event and leaves the popup open, which VCP owns.
378369 if ( target instanceof Node && ( this . _element . contains ( target ) || mainElement ?. contains ( target ) ) ) {
379370 return
380371 }
@@ -408,7 +399,6 @@ class Datepicker extends BaseComponent {
408399 this . _syncThemeAttribute ( self . context . mainElement )
409400 } ,
410401 onShow : ( ) => {
411- // Vanilla Calendar Pro defers the popup, so this can land after `dispose()`.
412402 if ( ! this . _calendar ) {
413403 return
414404 }
0 commit comments