joseluisq / printd

Print HTML elements or pages in modern browsers.
MIT License
80 stars 5 forks source link

Broken in IE11 #11

Closed jcmillett closed 4 years ago

jcmillett commented 4 years ago

Expected Behavior

Printing should work in IE11

Actual Behavior

Printing does not work in IE11. When attempting to print, a message is displayed in the console stating: "TypeError: Object doesn't support property or method 'assign'". It looks like this is caused by printd using Object.assign which isn't supported in IE11, so it needs a polyfill.

Steps to Reproduce the Problem

  1. In IE11 attempt to print using code like the following:
    const printd = new Printd();
    d.print( document.getElementById('myelement'), [ cssText ] );

Workaround

Manually polyfill Object.assign, but I think the distributable code for printd should already be including the polyfill.

Specifications

joseluisq commented 4 years ago

Object.assign is not supported. But here is the library + IE11 polyfill https://joseluisq.net/assets/printd/printd.umd.min.js. Due I have no IE11 environment to test it, It would be great if you can do it by yourself. Let me know about the results after your testing.

jcmillett commented 4 years ago

Thanks for responding. I just tested with that file and it looks like it works!

joseluisq commented 4 years ago

Great! A PR with the that fix will happen soon.

joseluisq commented 4 years ago

Done on release v1.4.2

jcmillett commented 4 years ago

@joseluisq Thanks for the quick reply and fix!