File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
components/date-picker/hooks
tdesign-vue-next/.changelog Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -58,8 +58,11 @@ export function useRange(props: TdDateRangePickerProps) {
5858 onClick : ( { position } : any ) => {
5959 activeIndex . value = position === 'first' ? 0 : 1 ;
6060 } ,
61- onClear : ( { e } : { e : MouseEvent } ) => {
62- e . stopPropagation ( ) ;
61+ onClear : ( context : { e : MouseEvent } | MouseEvent ) => {
62+ // 处理全局替换关闭图标的场景,此时 event 可能不在 context 里面,而是 context 本身
63+ if ( context instanceof MouseEvent ) context . stopPropagation ( ) ;
64+ else context . e . stopPropagation ( ) ;
65+
6366 popupVisible . value = false ;
6467 onChange ?.( [ ] , { dayjsValue : [ ] , trigger : 'clear' } ) ;
6568 } ,
Original file line number Diff line number Diff line change 1+ ---
2+ pr_number : 6108
3+ contributor : uyarn
4+ ---
5+
6+ - fix(DateRangePicker): 修复全局替换图标场景下,点击关闭按钮报错的问题 @uyarn ([ #6108 ] ( https://github.com/Tencent/tdesign-vue-next/pull/6108 ) )
You can’t perform that action at this time.
0 commit comments