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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use a data transfer object supplied by the event caller #858

Closed
wants to merge 4 commits into from
Closed

fix: use a data transfer object supplied by the event caller #858

wants to merge 4 commits into from

Conversation

johnjesse
Copy link
Contributor

@johnjesse johnjesse commented Dec 22, 2020

What:

Pass the data transfer value through to the event if it's already an instance of window.DataTransfer
see #857

Why:

If you try and use a real DataTransfer object for a drag/drop event it is thrown away and it's properties aren't copied over to the one created within create event.

How:

I test the dataTransferValue to see if it is an instanceof window.DataTransfer

Checklist:

  • Documentation added to the
    docs site N/A
  • Tests
  • Typescript definitions updated N/A
  • Ready to be merged

@johnjesse johnjesse changed the title fix: use a data transfewr object supplied by the event caller fix: use a data transfer object supplied by the event caller Dec 22, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 22, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 8807c56:

Sandbox Source
react-testing-library-examples Configuration

@marcosvega91
Copy link
Member

Hi @johnjesse could you please rebase this branch with master?

@codecov
Copy link

codecov bot commented Jan 4, 2021

Codecov Report

Merging #858 (8807c56) into master (c6acb0a) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #858   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        26           
  Lines          944       946    +2     
  Branches       285       287    +2     
=========================================
+ Hits           944       946    +2     
Flag Coverage Δ
node-10.14.2 100.00% <100.00%> (ø)
node-12 100.00% <100.00%> (ø)
node-14 100.00% <100.00%> (ø)
node-15 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/events.js 100.00% <100.00%> (ø)

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 c6acb0a...8807c56. Read the comment docs.

@nickmccurdy
Copy link
Member

@eps1lon Would we still want to support this considering the discussion #865?

@eps1lon
Copy link
Member

eps1lon commented Feb 11, 2021

@eps1lon Would we still want to support this considering the discussion #865?

I generally have a big problem with doing these polyfills in a library. So I'm the wrong person to ask since I was already against the original PR that started to polyfill these. This PR supports my position on not doing any polyfill in this library since it might cause bugs in proper environments.

@nickmccurdy
Copy link
Member

I think I agree with you on that, JSDOM workarounds can be pretty complex and sometimes cause more subtle bugs.

We can merge this if you're okay with it.

@johnjesse
Copy link
Contributor Author

Hey - just commenting to see if you want any changes on this PR or not, as it's been sat here for a while

@nickmccurdy
Copy link
Member

@eps1lon Do you think this is ready to merge?

@johnjesse
Copy link
Contributor Author

Is there any movement on this?

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants