fix: datepicker arrow error

pull/5674/head
tangjinzhou 2022-06-07 09:52:47 +08:00
parent e907ffd759
commit 71c6195771
1 changed files with 3 additions and 3 deletions

View File

@ -986,7 +986,6 @@ function RangerPicker<DateType>() {
) { ) {
// Arrow offset // Arrow offset
arrowLeft = startInputDivRef.value.offsetWidth + separatorRef.value.offsetWidth; arrowLeft = startInputDivRef.value.offsetWidth + separatorRef.value.offsetWidth;
if ( if (
panelDivRef.value.offsetWidth && panelDivRef.value.offsetWidth &&
arrowRef.value.offsetWidth && arrowRef.value.offsetWidth &&
@ -1001,7 +1000,8 @@ function RangerPicker<DateType>() {
} }
} }
const arrowPositionStyle = direction === 'rtl' ? { right: arrowLeft } : { left: arrowLeft }; const arrowPositionStyle =
direction === 'rtl' ? { right: `${arrowLeft}px` } : { left: `${arrowLeft}px` };
function renderPanels() { function renderPanels() {
let panels: VueNode; let panels: VueNode;
@ -1092,7 +1092,7 @@ function RangerPicker<DateType>() {
return ( return (
<div <div
class={`${prefixCls}-panel-container`} class={`${prefixCls}-panel-container`}
style={{ marginLeft: panelLeft }} style={{ marginLeft: `${panelLeft}px` }}
ref={panelDivRef} ref={panelDivRef}
onMousedown={e => { onMousedown={e => {
e.preventDefault(); e.preventDefault();