mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 05:06:55 +04:00
Fix autosize skipping position: fixed textareas (#3187)
This commit is contained in:
1 parent
3460091414
commit
c89bf8da57
3 files changed
+16
-1
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@tabler/core": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixed autosize not resizing a `position: fixed` textarea.
|
||||||
@@ -92,7 +92,7 @@ class Autosize extends BaseComponent {
|
|||||||
// Public
|
// Public
|
||||||
update(): void {
|
update(): void {
|
||||||
const element = this._element
|
const element = this._element
|
||||||
if (!element.isConnected || element.offsetParent === null) {
|
if (!element.isConnected || element.getClientRects().length === 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,16 @@ describe('Autosize', () => {
|
|||||||
|
|
||||||
expect(height()).toBe(46)
|
expect(height()).toBe(46)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should still update a position: fixed field', () => {
|
||||||
|
textarea().style.position = 'fixed'
|
||||||
|
const instance = new Autosize(textarea())
|
||||||
|
|
||||||
|
textarea().value = lines(3)
|
||||||
|
instance.update()
|
||||||
|
|
||||||
|
expect(height()).toBe(60)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('dispose', () => {
|
describe('dispose', () => {
|
||||||
|
|||||||
Reference in new issue
Block a user