-
Notifications
You must be signed in to change notification settings - Fork 684
feat(types): add min_lines/max_lines to RichTextInput #2680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@slack/types": minor | ||
| --- | ||
|
|
||
| feat(types): add optional `min_lines` and `max_lines` properties to `RichTextInput` element |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1066,4 +1066,13 @@ export interface RichTextInput extends Actionable, Dispatchable, Focusable, Plac | |||||
| * @description Initial contents of the input when it is loaded. | ||||||
| */ | ||||||
| initial_value?: RichTextBlock; | ||||||
| /** | ||||||
| * @description The minimum number of lines of text shown in the input. Must be between 1 and 50. | ||||||
| */ | ||||||
| min_lines?: number; | ||||||
| /** | ||||||
| * @description The maximum number of lines of text shown in the input before it scrolls. Must be between 1 and 50. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
🦠 note: Similar suggestion as above! |
||||||
| * Defaults to `8` when not specified. | ||||||
| */ | ||||||
| max_lines?: number; | ||||||
| } | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🌟 praise: Thanks for keeping qualities highest with test! I'm hoping we can organize this file as more coverage is added for other elements ongoing. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||
| import { expectAssignable, expectError } from 'tsd'; | ||||||
| import type { RichTextInput } from '../src/index'; | ||||||
|
|
||||||
| // RichTextInput — happy paths | ||||||
| expectAssignable<RichTextInput>({ | ||||||
| type: 'rich_text_input', | ||||||
| }); | ||||||
| expectAssignable<RichTextInput>({ | ||||||
| type: 'rich_text_input', | ||||||
| min_lines: 3, | ||||||
| }); | ||||||
| expectAssignable<RichTextInput>({ | ||||||
| type: 'rich_text_input', | ||||||
| max_lines: 16, | ||||||
| }); | ||||||
| expectAssignable<RichTextInput>({ | ||||||
| type: 'rich_text_input', | ||||||
| min_lines: 3, | ||||||
| max_lines: 16, | ||||||
| }); | ||||||
|
|
||||||
| // RichTextInput — sad paths | ||||||
| expectError<RichTextInput>({ | ||||||
| type: 'rich_text_input', | ||||||
| min_lines: '3', | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
🧪 suggestion(non-blocking): To make these spec more clear! |
||||||
| }); | ||||||
| expectError<RichTextInput>({ | ||||||
| type: 'rich_text_input', | ||||||
| max_lines: '16', | ||||||
| }); | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔬 question: I find the API docs suggest "100" as a maximum minimum - would this be something to update here or in reference?
🔗 https://docs.slack.dev/reference/block-kit/block-elements/rich-text-input-element/