Skip to content

Commit

Permalink
Prevent display style overrides from sites (#397)
Browse files Browse the repository at this point in the history
* fix: add display block forced style

* fix: log for debugging

* mor log

* fix: remove logs

* fix: add changeset

* Update .changeset/two-turkeys-join.md

Co-authored-by: Mateusz Burzyński <[email protected]>

---------

Co-authored-by: Mateusz Burzyński <[email protected]>
  • Loading branch information
Oyveloper and Andarist authored Oct 10, 2024
1 parent 5953e02 commit bf3cad8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/two-turkeys-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-textarea-autosize': patch
---

Force `display: block` for the hidden textarea to prevent other styles from overriding it and thus breaking the resizing functionality
2 changes: 1 addition & 1 deletion src/calculateNodeHeight.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SizingData } from './getSizingData';
import forceHiddenStyles from './forceHiddenStyles';
import { SizingData } from './getSizingData';

// TODO: use labelled tuples once they are avaiable:
// export type CalculatedNodeHeights = [height: number, rowHeight: number];
Expand Down
1 change: 1 addition & 0 deletions src/forceHiddenStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const HIDDEN_TEXTAREA_STYLE = {
'z-index': '-1000',
top: '0',
right: '0',
display: 'block',
} as const;

const forceHiddenStyles = (node: HTMLElement) => {
Expand Down

0 comments on commit bf3cad8

Please sign in to comment.