Skip to content

Commit

Permalink
fix: 修复 LayerPopup 点击时无法主动关闭
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed Sep 20, 2023
1 parent 0fe5887 commit 495bc4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ const useStyle = () => {
padding: 12px;
color: ${colorText};
background: ${colorBgElevated};
.l7-popup-close-button {
fill: ${colorText};
}
}
`,

Expand Down
2 changes: 2 additions & 0 deletions packages/li-core-assets/src/widgets/LayerPopup/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface LILayerPopupProps extends Properties, ImplementWidgetProps {}
const LILayerPopup: React.FC<LILayerPopupProps> = (props) => {
const { isOpen = true, trigger, items = [] } = props;
const styles = useStyle();
const isClick = trigger === 'click';

const popupItems: ILayerPopupConfigItem[] = useMemo(() => {
const list = items
Expand Down Expand Up @@ -76,6 +77,7 @@ const LILayerPopup: React.FC<LILayerPopupProps> = (props) => {
{isOpen && (
<LayerPopup
className={cls(CLS_PREFIX, styles.layerPopup)}
closeButton={isClick}
anchor="top-left"
offsets={[10, -10]}
items={popupItems}
Expand Down

0 comments on commit 495bc4d

Please sign in to comment.