This repository was archived by the owner on Mar 4, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
2323
2424### Fixes
2525- Fix a gap in ` Checkbox ` in RTL mode @layershifter ([ #1683 ] ( https://github.com/stardust-ui/react/pull/1683 ) )
26+ - Fix broken background in ` Popup ` with ` pointing ` and ` FocusTrap ` @layershifter ([ #1689 ] ( https://github.com/stardust-ui/react/pull/1689 ) )
2627
2728<!-- ------------------------------[ v0.34.1 ]------------------------------- -->
2829## [ v0.34.1] ( https://github.com/stardust-ui/react/tree/v0.34.1 ) (2019-07-11)
Original file line number Diff line number Diff line change 1+ import * as _ from 'lodash'
2+ import * as React from 'react'
13import { ComponentSlotStylesInput , ICSSInJSStyle } from '../../../types'
24import { PopupProps } from '../../../../components/Popup/Popup'
35import { PopupVariables } from './popupVariables'
46
57const popupStyles : ComponentSlotStylesInput < PopupProps , PopupVariables > = {
68 root : ( ) : ICSSInJSStyle => ( { } ) ,
79
8- popup : ( { variables : v } ) : ICSSInJSStyle => ( {
10+ popup : ( { props : p , variables : v } ) : ICSSInJSStyle => ( {
911 zIndex : v . zIndex ,
1012 position : 'absolute' ,
1113 textAlign : 'left' ,
12- color : v . contentColor ,
13- background : v . contentBackgroundColor ,
14+
15+ /*
16+ * This fix handles all cases with wrapped focus trap.
17+ */
18+ ...( ( React . isValidElement ( p . content ) || _ . isFunction ( p . content ) ) && {
19+ // when FocusTrap exists and `context` is JSX element or render() callback
20+ color : v . contentColor ,
21+ background : v . contentBackgroundColor ,
22+ } ) ,
23+ '&.ui-popup__content' : {
24+ // when there is no FocusTrap
25+ color : v . contentColor ,
26+ background : v . contentBackgroundColor ,
27+ } ,
28+ '& .ui-popup__content' : {
29+ // when FocusTrap exists
30+ color : v . contentColor ,
31+ background : v . contentBackgroundColor ,
32+ } ,
1433 } ) ,
1534}
1635
You can’t perform that action at this time.
0 commit comments