Skip to content

Commit a0eff5c

Browse files
authored
docs(onSelect): Document new behavior
1 parent 3675105 commit a0eff5c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ By default only the current active tab will be rendered to DOM. If set to `true`
119119
120120
> default: `undefined`
121121
122-
This event handler is called every time a tab is changed. It will be called with the `index` that will be changed to, the `lastIndex` which was selected before and the underlying `event` which is usually either a `keydown` or `click` event.
122+
This event handler is called every time a tab is about to changed. It will be called with the `index` that will be changed to, the `lastIndex` which was selected before and the underlying `event` which is usually either a `keydown` or `click` event. When `index` and `lastIndex` are equal it means the user clicked on the currently active tab.
123123
124124
The callback can optionally return `true` to cancel the change to the new tab.
125125
126-
> Returning `true` when the change to the new tab should be canceled is also important in controlled mode, as react-tabs still internally handles the focus of the tabs. (Really? maybe find a better way)
126+
> Returning `true` when the change to the new tab should be canceled is also important in controlled mode, as react-tabs still internally handles the focus of the tabs.
127127
128-
> In controlled mode ths `onSelect` handler is required prop.
128+
> In controlled mode the `onSelect` handler is a required prop.
129129
130130
#### selectedIndex: `number`
131131

0 commit comments

Comments
 (0)