Andarist / react-textarea-autosize

<textarea /> component for React which grows with content
http://andarist.github.io/react-textarea-autosize/
MIT License
2.22k stars 246 forks source link

TypeError in version `8.4.1` #368

Closed emmenko closed 1 year ago

emmenko commented 1 year ago
image

Updating from version 8.4.0 to 8.4.1 causes an error in our tests. Maybe related to the changes in #362 ?

cc @ArnaudRinquin

Andarist commented 1 year ago

Yes, it's likely related. JSDom doesn't implement document.fonts - that alone I don't classify as a problem. The runtime code of the library doesn't have to support JSDom quirks. However, the README currently states that:

This module supports IE9 and above.

And document.fonts is not available in IE. So I would accept a PR fixing this.

soulakmartin commented 1 year ago

+1

I have same issue.

ArnaudRinquin commented 1 year ago

Sorry folks, only noticed this issue now. Proposed something that should fix this.

billdwhite commented 1 year ago

+1 same issue here

oleh-demkovych commented 1 year ago

A temporary solution is to mock document.fonts in jest:


Object.defineProperty(document, 'fonts', {
  value: { addEventListener() {}, removeEventListener() {} },
});