File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
packages/devextreme/js/__internal Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 1+ import type { dxElementWrapper } from '@js/core/renderer' ;
12import $ from '@js/core/renderer' ;
23import { value } from '@js/core/utils/view_port' ;
34
45const SWATCH_CONTAINER_CLASS_PREFIX = 'dx-swatch-' ;
56
6- const getSwatchContainer = ( element ) => {
7+ const getSwatchContainer = (
8+ element : Element | dxElementWrapper ,
9+ ) : dxElementWrapper => {
710 const $element = $ ( element ) ;
811 const swatchContainer = $element . closest ( `[class^="${ SWATCH_CONTAINER_CLASS_PREFIX } "], [class*=" ${ SWATCH_CONTAINER_CLASS_PREFIX } "]` ) ;
9- const viewport = value ( ) ;
10- if ( ! swatchContainer . length ) return viewport ;
12+ const viewport : dxElementWrapper = value ( ) ;
13+
14+ if ( ! swatchContainer . length ) {
15+ return viewport ;
16+ }
1117
1218 const swatchClassRegex = new RegExp ( `(\\s|^)(${ SWATCH_CONTAINER_CLASS_PREFIX } .*?)(\\s|$)` ) ;
1319 const swatchClass = swatchContainer [ 0 ] . className . match ( swatchClassRegex ) [ 2 ] ;
Original file line number Diff line number Diff line change @@ -210,9 +210,11 @@ export class OverlayPositionController<
210210 this . _properties . container = element ;
211211 }
212212
213- this . _$markupContainer = element
214- ? $ ( element )
215- : swatch . getSwatchContainer ( this . _$root ) ;
213+ if ( element ) {
214+ this . _$markupContainer = $ ( element ) ;
215+ } else if ( this . _$root ) {
216+ this . _$markupContainer = swatch . getSwatchContainer ( this . _$root ) ;
217+ }
216218
217219 this . updateVisualContainer ( this . _properties . visualContainer ) ;
218220 }
You can’t perform that action at this time.
0 commit comments