File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -950,7 +950,7 @@ class Popover extends PopoverPositionMixin(
950
950
}
951
951
952
952
// Restore pointer-events set when opening on hover.
953
- if ( this . modal && this . target . style . pointerEvents ) {
953
+ if ( this . modal && this . target && this . target . style . pointerEvents ) {
954
954
this . target . style . pointerEvents = '' ;
955
955
}
956
956
Original file line number Diff line number Diff line change @@ -148,6 +148,21 @@ describe('popover', () => {
148
148
149
149
expect ( document . activeElement ) . to . not . equal ( target ) ;
150
150
} ) ;
151
+
152
+ it ( 'should not throw when target is removed' , async ( ) => {
153
+ popover . modal = true ;
154
+
155
+ // Clear target
156
+ popover . target = null ;
157
+ await nextUpdate ( popover ) ;
158
+
159
+ popover . opened = true ;
160
+ await oneEvent ( overlay , 'vaadin-overlay-open' ) ;
161
+
162
+ // No error should be thrown
163
+ popover . opened = false ;
164
+ await oneEvent ( popover , 'closed' ) ;
165
+ } ) ;
151
166
} ) ;
152
167
153
168
describe ( 'for' , ( ) => {
You can’t perform that action at this time.
0 commit comments