问题
Could someone please tell me why datepicker flickers in React when focus in input field?
I am using this date picker in my demo
https://www.npmjs.com/package/semantic-ui-calendar-react
but it flickers on focus or in other words when I focus to input field its first show on top and then come down below input field, why? Here is my code
https://codesandbox.io/s/prod-hill-mpurn
<div style={{ position: "absolute", top: 100, left: 100 }}>
<DateInput
name="date"
placeholder="Date"
value={date}
popupPosition="right"
onChange={handleChange}
/>
</div>
Any update ?
回答1:
It has a default animation of scale
. You can turn it off by passing the prop `animation={false} like the following.
<DateInput
name="date"
placeholder="Date"
value={date}
popupPosition="right"
onChange={handleChange}
animation={false}
/>
CodeSandbox: https://codesandbox.io/s/hloid
来源:https://stackoverflow.com/questions/57618248/why-datepicker-flicker-in-react-when-focus-in-input-field