tleunen / react-mdl

React Components for Material Design Lite
https://tleunen.github.io/react-mdl/
MIT License
1.76k stars 255 forks source link

Detecting Dialog backdrop clicks. #475

Closed saboya closed 6 years ago

saboya commented 7 years ago

This PR allows the user to pass a function to be called when the Dialog backdrop is clicked by checking if the user click is inside the bounds of the modal dialog. It accounts for the possibility of fields that don't report clientY / clientX correctly (like selectfield).

This was tested with Google Chrome only.

codecov-io commented 6 years ago

Codecov Report

Merging #475 into master will decrease coverage by 0.18%. The diff coverage is 33.33%.

Impacted Files Coverage Δ
src/Dialog/Dialog.js 77.14% <33.33%> (-22.86%) :arrow_down:
src/DataTable/__tests__/Selectable-test.js 97.67% <0%> (-0.09%) :arrow_down:
src/Tabs/TabBar.js 100% <0%> (ø) :arrow_up:
src/Layout/HeaderTabs.js 100% <0%> (ø) :arrow_up:
src/Checkbox.js 100% <0%> (ø) :arrow_up:
src/Grid/Cell.js 100% <0%> (ø) :arrow_up:
src/Card/CardTitle.js 100% <0%> (ø) :arrow_up:
src/List/__tests__/ListItemContent-test.js 100% <0%> (ø) :arrow_up:
src/Snackbar/index.js 100% <0%> (ø) :arrow_up:
src/Layout/Header.js 100% <0%> (ø) :arrow_up:
... and 44 more