Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6e6f541

Browse filesBrowse files
authored
Add question ID to checkbox tooltip (seanprashad#132)
Fixes seanprashad#130
1 parent 5ae567d commit 6e6f541
Copy full SHA for 6e6f541

File tree

Expand file treeCollapse file tree

1 file changed

+19
-15
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+19
-15
lines changed

‎src/components/Table/index.js

Copy file name to clipboardExpand all lines: src/components/Table/index.js
+19-15Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -158,22 +158,26 @@ const Table = () => {
158158
id: 'Checkbox',
159159
Cell: cellInfo => {
160160
return (
161-
<input
162-
type="checkbox"
163-
checked={checked[cellInfo.row.original.id]}
164-
onChange={() => {
165-
checked[cellInfo.row.original.id] = !checked[
166-
cellInfo.row.original.id
167-
];
161+
<span data-tip={`Question #${Number(cellInfo.row.id) + 1}`}>
162+
<input
163+
type="checkbox"
164+
checked={checked[cellInfo.row.original.id]}
165+
onChange={() => {
166+
checked[cellInfo.row.original.id] = !checked[
167+
cellInfo.row.original.id
168+
];
168169

169-
const additive = checked[cellInfo.row.original.id] ? 1 : -1;
170-
difficultyCount[
171-
cellInfo.row.original.difficulty
172-
] += additive;
173-
setDifficultyCount(difficultyCount);
174-
setChecked([...checked]);
175-
}}
176-
/>
170+
const additive = checked[cellInfo.row.original.id]
171+
? 1
172+
: -1;
173+
difficultyCount[
174+
cellInfo.row.original.difficulty
175+
] += additive;
176+
setDifficultyCount(difficultyCount);
177+
setChecked([...checked]);
178+
}}
179+
/>
180+
</span>
177181
);
178182
},
179183
},

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.