Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

table: Correct onRow event handlers to receive a MouseEvent #18910

Merged
merged 1 commit into from Sep 20, 2019

Conversation

@TLadd
Copy link

commented Sep 19, 2019

... instead of a SyntheticEvent

馃 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

馃敆 Related issue link

馃挕 Background and solution

The definition for the table events supplied in onRow is currently defined as a SyntheticEvent, but it can be more specific. All of those event handlers receive a MouseEvent. Can confirm that by viewing the React types and all of these event handlers show are typed as MouseEventHandler https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L1339. MouseEvent gives you access to things like e.ctrlKey and other mouse-specific fields. Our use-case that required this was opening a page in a new tab when a row is cmd-clicked.

馃摑 Changelog

Language Changelog
馃嚭馃嚫 English Corrected the TableEventListeners type to receive React.MouseEvent instead of the more generic React.SyntheticEvent
馃嚚馃嚦 Chinese

鈽戯笍 Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • [] Changelog is provided or not needed
@pr-triage pr-triage bot added the PR: unreviewed label Sep 19, 2019
@netlify

This comment has been minimized.

Copy link

commented Sep 19, 2019

Deploy preview for ant-design ready!

Built with commit f6b0215

https://deploy-preview-18910--ant-design.netlify.com

@codecov

This comment has been minimized.

Copy link

commented Sep 19, 2019

Codecov Report

Merging #18910 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #18910   +/-   ##
=======================================
  Coverage   96.92%   96.92%           
=======================================
  Files         281      281           
  Lines        7548     7548           
  Branches     2106     2061   -45     
=======================================
  Hits         7316     7316           
  Misses        230      230           
  Partials        2        2

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 974fb1b...f6b0215. Read the comment docs.

@afc163 afc163 merged commit 3e4fd43 into ant-design:master Sep 20, 2019
25 of 28 checks passed
25 of 28 checks passed
Semantic Pull Request add a semantic commit or PR title
Details
Header rules - ant-design No header rules processed
Details
Pages changed - ant-design 217 new files uploaded
Details
DEP All dependencies are resolved
LGTM analysis: JavaScript No new or fixed alerts
Details
Mixed content - ant-design No mixed content detected
Details
Redirect rules - ant-design 18 redirect rules processed
Details
WIP Ready for review
Details
buildsize No change
Details
ci/circleci: check_metadata Your tests passed on CircleCI!
Details
ci/circleci: compile Your tests passed on CircleCI!
Details
ci/circleci: dist Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: test_dist Your tests passed on CircleCI!
Details
ci/circleci: test_dist_15 Your tests passed on CircleCI!
Details
ci/circleci: test_dom Your tests passed on CircleCI!
Details
ci/circleci: test_dom_15 Your tests passed on CircleCI!
Details
ci/circleci: test_es Your tests passed on CircleCI!
Details
ci/circleci: test_es_15 Your tests passed on CircleCI!
Details
ci/circleci: test_lib Your tests passed on CircleCI!
Details
ci/circleci: test_lib_15 Your tests passed on CircleCI!
Details
ci/circleci: test_node Your tests passed on CircleCI!
Details
ci/circleci: test_node_15 Your tests passed on CircleCI!
Details
codecov/patch Coverage not affected when comparing 974fb1b...f6b0215
Details
codecov/project 96.92% remains the same compared to 974fb1b
Details
netlify/ant-design/deploy-preview Deploy preview ready!
Details
security/snyk - package.json (paranoidjk) No manifest changes detected
@pr-triage pr-triage bot added PR: merged and removed PR: unreviewed labels Sep 20, 2019
@zombieJ zombieJ referenced this pull request Sep 21, 2019
1 of 10 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can鈥檛 perform that action at this time.