Skip to content

Commit 2c46820

Browse files
committed
[added] createSelectedEvent for consistent onSelect handling
Related to react-bootstrap#419
1 parent 5d40ab3 commit 2c46820

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/utils/createSelectedEvent.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export default function createSelectedEvent(eventKey) {
2+
let selectionPrevented = false;
3+
4+
return {
5+
eventKey,
6+
7+
preventSelection() {
8+
selectionPrevented = true;
9+
},
10+
11+
isSelectionPrevented() {
12+
return selectionPrevented;
13+
}
14+
};
15+
}

0 commit comments

Comments
 (0)