Skip to content

Commit

Permalink
Fix missing selection indicator handles when the selected line is on …
Browse files Browse the repository at this point in the history
…the last line of the rich html editor

If there isn't enough space below the last line of the rich html editor, the selection handles do not show when selecting the last line. The handles should be drawn below the last line but apparently, not having enough space makes them not start drawing at all.

To fix this issue, I always add margins to the bottom of the editor in order to always have exactly one line worth of extra space at the bottom of the editor. To accommodate for the extra space in the editor, I need to add negative margin to the signature so it still looks exactly how it will be when the draft is saved/sent and I need to fix the alignement of the placeholder when the editor is empty.
  • Loading branch information
LunarX committed Aug 9, 2024
1 parent 8dd7551 commit b7cec4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/src/main/res/layout/fragment_new_message.xml
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/marginStandardMedium"
android:paddingBottom="@dimen/marginStandardMedium"
android:text="@string/newMessagePlaceholderTitle"
android:textColor="@color/tertiaryTextColor"
android:visibility="gone"
Expand Down Expand Up @@ -361,6 +362,7 @@
android:id="@+id/signatureWebView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-16dp"
android:layout_marginBottom="@dimen/marginStandardMedium"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/raw/editor_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ html {

body {
margin-top: 0px;
margin-bottom: 0px;
margin-bottom: 1rem;
}

0 comments on commit b7cec4b

Please sign in to comment.