feat(types): add min_lines/max_lines to RichTextInput - #2680
Conversation
🦋 Changeset detectedLatest commit: d2941d3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2680 +/- ##
=======================================
Coverage 89.11% 89.11%
=======================================
Files 65 65
Lines 10339 10339
Branches 471 471
=======================================
Hits 9214 9214
Misses 1095 1095
Partials 30 30
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
| */ | ||
| initial_value?: RichTextBlock; | ||
| /** | ||
| * @description The minimum number of lines of text shown in the input. Must be between 1 and 50. |
There was a problem hiding this comment.
| * @description The minimum number of lines of text shown in the input. Must be between 1 and 50. | |
| * @description The minimum number of lines of text shown in the input. Must be between 1 and 100. |
🔬 question: I find the API docs suggest "100" as a maximum minimum - would this be something to update here or in reference?
The minimum number of visible text lines the input should display before scrolling. Controls the initial height of the input. Must be between 1 and 100.
🔗 https://docs.slack.dev/reference/block-kit/block-elements/rich-text-input-element/
| */ | ||
| min_lines?: number; | ||
| /** | ||
| * @description The maximum number of lines of text shown in the input before it scrolls. Must be between 1 and 50. |
There was a problem hiding this comment.
| * @description The maximum number of lines of text shown in the input before it scrolls. Must be between 1 and 50. | |
| * @description The maximum number of lines of text shown in the input before it scrolls. Must be between 1 and 100. |
🦠 note: Similar suggestion as above!
| // RichTextInput — sad paths | ||
| expectError<RichTextInput>({ | ||
| type: 'rich_text_input', | ||
| min_lines: '3', |
There was a problem hiding this comment.
| min_lines: '3', | |
| min_lines: '3', // Minimum should be integer |
🧪 suggestion(non-blocking): To make these spec more clear!
There was a problem hiding this comment.
🌟 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.
Summary
Adds optional
min_linesandmax_linesinteger properties to theRichTextInputBlock Kit element interface, allowing developers to control the visible height ofrich_text_inputelements.min_lines— minimum number of visible lines (1–50)max_lines— maximum number of visible lines before scrolling (1–50, defaults to 8 on the platform when unset)Both properties are optional, preserving full backward compatibility.
Testing
Test app.js
Requirements