Why datepicker flicker in React when focus in input field?

北慕城南 提交于 2020-05-29 10:19:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!