-
Notifications
You must be signed in to change notification settings - Fork 839
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EuiPopover] Fix filter
drop-shadow
bug (#6604)
* Fix filter drop-shadow bug in popovers * Add CL entry * CSS indentation * Update src/themes/amsterdam/global_styling/mixins/shadow.ts Co-authored-by: Cee Chen <[email protected]> * Update src/themes/amsterdam/global_styling/mixins/shadow.ts Co-authored-by: Cee Chen <[email protected]> * Removed unused array --------- Co-authored-by: Cee Chen <[email protected]>
- Loading branch information
1 parent
7933593
commit 8cf4d8f
Showing
6 changed files
with
119 additions
and
61 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
import React, { useState } from 'react'; | ||
|
||
import { | ||
EuiButton, | ||
EuiContextMenuPanel, | ||
EuiPopover, | ||
EuiSelectable, | ||
EuiSelectableOption, | ||
EuiHorizontalRule, | ||
EuiContextMenuItem, | ||
EuiTitle, | ||
EuiSpacer, | ||
EuiPanel, | ||
} from '../../../../src/components'; | ||
|
||
import { useGeneratedHtmlId } from '../../../../src/services'; | ||
|
||
export default () => { | ||
const [isPopoverOpen, setPopover] = useState(false); | ||
const customContextMenuPopoverId = useGeneratedHtmlId({ | ||
prefix: 'customContextMenuPopover', | ||
}); | ||
|
||
const onButtonClick = () => { | ||
setPopover(!isPopoverOpen); | ||
}; | ||
|
||
const closePopover = () => { | ||
setPopover(false); | ||
}; | ||
|
||
const button = ( | ||
<EuiButton | ||
size="s" | ||
iconType="arrowDown" | ||
iconSide="right" | ||
onClick={onButtonClick} | ||
> | ||
Click to show some content | ||
</EuiButton> | ||
); | ||
|
||
const [options, setOptions] = useState<EuiSelectableOption[]>([ | ||
{ | ||
label: 'APM', | ||
}, | ||
{ | ||
label: 'filebeat-*', | ||
}, | ||
{ | ||
label: 'logs-*', | ||
}, | ||
{ | ||
label: 'metrics-*', | ||
}, | ||
]); | ||
|
||
return ( | ||
<EuiPopover | ||
id={customContextMenuPopoverId} | ||
button={button} | ||
isOpen={isPopoverOpen} | ||
closePopover={closePopover} | ||
panelPaddingSize="none" | ||
anchorPosition="downLeft" | ||
> | ||
<EuiContextMenuPanel> | ||
<EuiContextMenuItem key="item-1" icon="indexOpen" size="s"> | ||
Add a field to this data view | ||
</EuiContextMenuItem> | ||
<EuiContextMenuItem key="item-2" icon="indexSettings" size="s"> | ||
Manage this data view | ||
</EuiContextMenuItem> | ||
|
||
<EuiHorizontalRule margin="none" /> | ||
|
||
<EuiPanel color="transparent" paddingSize="s"> | ||
<EuiTitle size="xxxs"> | ||
<h3>Data views</h3> | ||
</EuiTitle> | ||
<EuiSpacer size="s" /> | ||
<EuiSelectable | ||
aria-label="Find a data view" | ||
searchable | ||
searchProps={{ | ||
compressed: true, | ||
placeholder: 'Find a data view', | ||
}} | ||
options={options} | ||
onChange={(newOptions) => setOptions(newOptions)} | ||
> | ||
{(list, search) => ( | ||
<> | ||
{search} | ||
{list} | ||
</> | ||
)} | ||
</EuiSelectable> | ||
</EuiPanel> | ||
</EuiContextMenuPanel> | ||
</EuiPopover> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
**Bug fixes** | ||
|
||
- Fixed bug in `EuiPopover` where multiple filter `drop-shadow()` were causing inner shadows in Safari |