fix: when fullscreen is false, the element returned by dateFullCellRender cannot be interactive (#34614)

* fix: when fullscreen is false, the element returned by dateFullCellRender cannot be interactive

* test: add test for Calendar
This commit is contained in:
章鱼 2022-03-21 23:11:48 +08:00 committed by GitHub
parent 232e236215
commit 4debb88f24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -403,4 +403,20 @@ describe('Calendar', () => {
);
expect(wrapper.find('.bamboo').first().text()).toEqual('Light');
});
it('when fullscreen is false, the element returned by dateFullCellRender should be interactive', () => {
const onClick = jest.fn();
const wrapper = mount(
<Calendar
fullscreen={false}
dateFullCellRender={() => (
<div className="bamboo" onClick={onClick}>
Light
</div>
)}
/>,
);
wrapper.find('.bamboo').first().simulate('click');
expect(onClick).toBeCalled();
});
});

View File

@ -70,6 +70,10 @@
line-height: 18px;
}
}
.@{calendar-picker-prefix-cls}-cell::before {
pointer-events: none;
}
}
// ========================== Full ==========================