Skip to content

Commit

Permalink
Add max-height multiline input example (#3987)
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Wooding <[email protected]>
  • Loading branch information
liamsms and joshwooding authored Oct 8, 2024
1 parent 5eb77be commit b2af86a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/orange-tips-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@salt-ds/core": patch
---

Updated MultilineInput so that it is easier to set a max-height.
1 change: 1 addition & 0 deletions packages/core/src/multiline-input/MultilineInput.css
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
margin: var(--salt-spacing-75) 0;
min-width: 0;
min-height: 0;
max-height: inherit;
resize: vertical;
padding: 0;
}
Expand Down
7 changes: 7 additions & 0 deletions site/docs/components/multiline-input/examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,12 @@ You can use a [button](../button) at the beginning or end of the multiline input

If you've disabled the containing multiline input or set it to a read-only state, ensure your interactive buttons match that state.

</LivePreview>
<LivePreview componentName="multiline-input" exampleName="MaxHeight" >

## Max rows

To control the number of maximum rows visible, you can set a max height for the multiline input.

</LivePreview>
</LivePreviewControls>
9 changes: 9 additions & 0 deletions site/src/examples/multiline-input/MaxHeight.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { MultilineInput } from "@salt-ds/core";
import type { ReactElement } from "react";

export const MaxHeight = (): ReactElement => (
<MultilineInput
defaultValue="Value"
style={{ maxWidth: "256px", maxHeight: "256px" }}
/>
);
1 change: 1 addition & 0 deletions site/src/examples/multiline-input/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ export * from "./Readonly";
export * from "./Secondary";
export * from "./StaticAdornments";
export * from "./ValidationStatus";
export * from "./MaxHeight";

0 comments on commit b2af86a

Please sign in to comment.