React-day-picker: console warning: Received `false` for non-boolean attribute `tabIndex` (React 16)

Created on 11 Sep 2017  路  6Comments  路  Source: gpbl/react-day-picker

Please see: https://codesandbox.io/s/ory016yr9 with developer tools open.

Using react 16.0.0-rc.2, react-day-picker 6.1.0

<DayPicker canChangeMonth={false} selectedDays={new Date()} />

Displays the following in developer console:

**Warning: Received `false` for non-boolean attribute `tabIndex`. If this is expected, cast the value to a string.
    in div (created by DayPicker)
    in div (created by DayPicker)**

I don't know how to create a Pull Request, but on my local, the warning disappears if I modify
DayPicker.js.

- tabIndex: this.props.canChangeMonth && this.props.tabIndex,
+ tabIndex: (this.props.canChangeMonth && this.props.tabIndex ? this.props.tabIndex : "-1"),

Thank you.

Most helpful comment

I say the people who are responsible for REACT should fix this - cast whatever they need but not force us to cast ourselves.

All 6 comments

Thanks @vulcanoidlogic for the report!

Fixed in #501

Published as 6.2.0.

I say the people who are responsible for REACT should fix this - cast whatever they need but not force us to cast ourselves.

@gpbl can this fix be backported to the 5.x.x branch?

@davidspiess I think yes? I've never published a prev version! Try to send a PR, versions are tagged. Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leiit picture leiit  路  6Comments

olimination picture olimination  路  4Comments

pmartiner picture pmartiner  路  3Comments

NikitaSasin picture NikitaSasin  路  5Comments

trevordmiller picture trevordmiller  路  4Comments