javascript - airbnb/react-dates - 无法在日期字段中编辑/输入

标签 javascript node.js reactjs node-modules

我正在使用airbnb/react-dates供用户选择或输入开始和结束日期。但是我无法编辑日期字段。我可以选择日期,但无法在日期字段中输入内容。

我尝试阅读下面的链接,但到目前为止还没有运气 https://github.com/airbnb/react-dates http://airbnb.io/react-dates/?selectedKind=DateRangePicker%20%28DRP%29&selectedStory=default&full=0&down=1&left=1&panelRight=0&downPanel=kadirahq%2Fstorybook-addon-actions%2Factions-panel https://github.com/airbnb/react-dates/issues/79

在我的 package.json 中我有 “ react 日期”:“^12.6.0”

我正在使用以下 Prop 并在 Chrome 中运行它。

<DateRangePicker
        className="clientsPaging"
        displayFormat={"YYYY-MM-DD"}
        startDate={this.state.startDate} // momentPropTypes.momentObj or null,
        endDate={this.state.endDate} // momentPropTypes.momentObj or null,
        onDatesChange={this.datesChanged} // PropTypes.func.isRequired,
        isOutsideRange={() => false}
        focusedInput={this.state.focusedInput} // PropTypes.oneOf([START_DATE, END_DATE]) or null,
        onFocusChange={focusedInput => this.setState({ focusedInput })} // PropTypes.func.isRequired,
      />

最佳答案

在此版本中光标不可见,但您仍然可以在字段中书写。 如果不是,请尝试将 readOnly 强制设置为 false

关于javascript - airbnb/react-dates - 无法在日期字段中编辑/输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46311908/

相关文章:

javascript - 使用 AngularJS 时出现 ".then() is not a function"错误

javascript - Highcharts 根据数据系列值自定义显示工具提示

node.js - 从回调中捕获异常

javascript - 在 node.js 中读写一个 json 文件

reactjs - 与 FlowRouter react : How to show/hide component based on route

javascript - 不会识别 html 表中的第一个和最后一个值

node.js - Mapbox gl原生拼接间距大于0的瓷砖

reactjs - 按日期过滤 react 管理查询

reactjs - axios 调用 useReducer 返回 promise 而不是数据

javascript - google电子表格导出为json文件,如何格式化?