Skip to content

Commit

Permalink
Merge pull request #2003 from Infomaniak/fix-selection-indicator-editor
Browse files Browse the repository at this point in the history
Fix missing selection indicator handles when the selected line is on the last line of the rich html editor
  • Loading branch information
LunarX authored Aug 9, 2024
2 parents d365308 + 766de95 commit f80fc66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions app/src/main/res/layout/fragment_new_message.xml
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,16 @@
android:layout_marginTop="@dimen/marginStandardMedium"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/attachmentsRecyclerView" />
app:layout_constraintTop_toBottomOf="@id/attachmentsRecyclerView"
tools:layout_height="100dp" />

<TextView
android:id="@+id/newMessagePlaceholder"
android:layout_width="wrap_content"
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 @@ -356,14 +358,20 @@
android:maxWidth="200dp" />
</LinearLayout>

<!--This view is has exactly one line of text worth of negative top margin because the editor has the same
amount of extra space as "bottom margin". This way the editor and the signature continue being aligned exactly
how they will look like when the email is sent. The editor extra bottom margin is needed to display selection
handles correctly-->
<WebView
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"
app:layout_constraintTop_toBottomOf="@id/editorWebView" />
app:layout_constraintTop_toBottomOf="@id/editorWebView"
tools:layout_height="50dp" />

<com.google.android.material.button.MaterialButton
android:id="@+id/removeSignature"
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 f80fc66

Please sign in to comment.