Skip to content

Commit

Permalink
#6861: Use available space to make focus on Composer TextInput easier
Browse files Browse the repository at this point in the history
  • Loading branch information
GrizliK1988 committed Dec 20, 2024
1 parent ea6ac25 commit c4d9466
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ a[role='link'][data-no-underline='1']:hover {
/* ProseMirror */
.ProseMirror-dark {
color: white;
flex: 1;
}
.ProseMirror-light {
flex: 1;
}
.ProseMirror p {
margin: 0;
Expand Down
3 changes: 2 additions & 1 deletion src/view/com/composer/Composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ export const ComposePost = ({
layout={native(LinearTransition)}
onScroll={scrollHandler}
style={styles.scrollView}
contentContainerStyle={a.flex_1}
keyboardShouldPersistTaps="always"
onContentSizeChange={onScrollViewContentSizeChange}
onLayout={onScrollViewLayout}>
Expand Down Expand Up @@ -773,7 +774,7 @@ let ComposerPost = React.memo(function ComposerPost({
)

return (
<View style={[styles.post, !isActive && styles.inactivePost]}>
<View style={[styles.post, !isActive && styles.inactivePost, a.flex_1]}>
<View
style={[
styles.textInputLayout,
Expand Down
1 change: 1 addition & 0 deletions src/view/com/composer/text-input/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ export const TextInput = forwardRef(function TextInputImpl(
style={[
inputTextStyle,
a.w_full,
a.h_full,
{
textAlignVertical: 'top',
minHeight: 60,
Expand Down
3 changes: 3 additions & 0 deletions src/view/com/composer/text-input/TextInput.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ export const TextInput = React.forwardRef(function TextInputImpl(
? ((style.lineHeight + 'px') as unknown as number)
: undefined
style.minHeight = webForceMinHeight ? 140 : undefined
style.display = 'flex'
style.flexDirection = 'column'
style.alignItems = 'stretch'
return style
}, [t, fonts, webForceMinHeight])

Expand Down

0 comments on commit c4d9466

Please sign in to comment.