Skip to content

Commit

Permalink
Fixing the focus reset when opening up the tile's comment box (#1218)
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusallein authored Feb 4, 2020
1 parent 03d0a50 commit 70bc20e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/eyeballing/src/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,11 @@ function Home() {

const handleComment = (dataset) => {
api.commentsByDataset(dataset.id).then((res) => {
setCurrentDataset(dataset);
// In case of the comment button being fired,
// verify if it isn't the button of the current dataset.
if (dataset.id !== currentDataset.id) {
setCurrentDataset(dataset);
}
setComments(res);
setShowComment(true);
});
Expand Down

0 comments on commit 70bc20e

Please sign in to comment.