diff --git a/packages/zent/__tests__/popover.js b/packages/zent/__tests__/popover.js index 5fc3843adb..6fffa834c8 100644 --- a/packages/zent/__tests__/popover.js +++ b/packages/zent/__tests__/popover.js @@ -126,13 +126,13 @@ describe('Popover', () => { expect(wrapper.find('PurePortal').length).toBe(0); // 快速进入又快速离开 - wrapper.find('button').simulate('mouseenter'); + wrapper.find('button').simulate('pointerenter'); expect(wrapper.find('PurePortal').length).toBe(0); - wrapper.find('button').simulate('mouseleave'); + wrapper.find('button').simulate('pointerleave'); expect(wrapper.find('PurePortal').length).toBe(0); // hover 直到popup,然后window监听mousemove,判断是否离开。 - simulateWithTimers(wrapper.find('button'), 'mouseenter'); + simulateWithTimers(wrapper.find('button'), 'pointerenter'); wrapper.update(); expect(wrapper.find('PurePortal').length).toBe(1); const fakeEvent = new MouseEvent('mousemove'); @@ -434,7 +434,7 @@ describe('Popover', () => { ); - simulateWithTimers(wrapper.find('button'), 'mouseenter'); + simulateWithTimers(wrapper.find('button'), 'pointerenter'); wrapper.update(); expect(wrapper.find('PurePortal').length).toBe(1); diff --git a/packages/zent/src/grid/SelectionCheckbox.tsx b/packages/zent/src/grid/SelectionCheckbox.tsx index b116fb94bb..e3dcc23e51 100644 --- a/packages/zent/src/grid/SelectionCheckbox.tsx +++ b/packages/zent/src/grid/SelectionCheckbox.tsx @@ -71,9 +71,7 @@ class SelectionCheckbox extends PureComponent< const { checked } = this.state; return reason && disabled ? ( - - - + ) : ( diff --git a/packages/zent/src/grid/SelectionRadio.tsx b/packages/zent/src/grid/SelectionRadio.tsx index 6fb93a02d1..39e995e268 100644 --- a/packages/zent/src/grid/SelectionRadio.tsx +++ b/packages/zent/src/grid/SelectionRadio.tsx @@ -79,9 +79,7 @@ class SelectionCheckbox extends PureComponent< const { checked } = this.state; return reason && disabled ? ( - - - + ) : ( diff --git a/packages/zent/src/popover/trigger/HoverTrigger.tsx b/packages/zent/src/popover/trigger/HoverTrigger.tsx index c5c99a1ede..7bef68ac41 100644 --- a/packages/zent/src/popover/trigger/HoverTrigger.tsx +++ b/packages/zent/src/popover/trigger/HoverTrigger.tsx @@ -110,11 +110,11 @@ export function PopoverHoverTrigger< }); } else if (isElement(children)) { child = cloneElement(children, { - onMouseEnter(...args: any[]) { + onPointerEnter(...args: any[]) { children.props.onMouseEnter?.(...args); visible$.next(true); }, - onMouseLeave(...args: any[]) { + onPointerLeave(...args: any[]) { children.props.onMouseLeave?.(...args); visible$.next(false); }, @@ -122,8 +122,8 @@ export function PopoverHoverTrigger< } else { child = ( visible$.next(true)} - onMouseLeave={() => visible$.next(false)} + onPointerEnter={() => visible$.next(true)} + onPointerLeave={() => visible$.next(false)} > {children}