mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-07-14 10:20:42 +03:00
Fix autoresize not working well in Firefox on page load
This commit is contained in:
parent
a61ed6a1de
commit
98b348325a
@ -12,6 +12,17 @@ CustomElement.create({
|
||||
onConnect: function () {
|
||||
this._textarea = this.querySelector("textarea");
|
||||
this._updateListener();
|
||||
|
||||
// In Firefox, for some reason, the `scrollHeight` property isn't correct
|
||||
// when the component is connected. It is correct when the window loads, though,
|
||||
// so we also perform a resize when that happens.
|
||||
// We end up doing this in all browsers, but it's fine: the second resize is a no-op.
|
||||
var self = this;
|
||||
window.addEventListener("load", function () {
|
||||
if (self._autoresize) {
|
||||
self._resize();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
observedAttributes: ["data-autoresize"],
|
||||
|
@ -20,8 +20,9 @@ module Nri.Ui.TextArea.V5 exposing
|
||||
|
||||
### Patch changes
|
||||
|
||||
- no longer defaults the placeholder value to the label text
|
||||
- No longer defaults the placeholder value to the label text
|
||||
- Adjust disabled styles
|
||||
- Fix initial autoresize not working in Firefox
|
||||
|
||||
|
||||
### Changes from V4
|
||||
|
Loading…
Reference in New Issue
Block a user