TextFieldBoxes icon indicating copy to clipboard operation
TextFieldBoxes copied to clipboard

View disappears after pasting big text

Open ako2345 opened this issue 6 years ago • 5 comments

I have TextFieldBoxes with maxCharacters="500". After several pastes of ~100 symbols from clipboard the view disappears.

ako2345 avatar Feb 27 '18 16:02 ako2345

Weird. But I can't reproduce. image

Try 1.4.1, it may have fixed several rendering issues.

HITGIF avatar Feb 27 '18 16:02 HITGIF

It is reproduced on 1.4.1. Seems like the problem takes place when TextFieldBoxes is inside ScrollView. Here is the layout:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingBottom="40dp">

        <studio.carbonylgroup.textfieldboxes.TextFieldBoxes
            android:id="@+id/container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="24dp"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
            android:layout_marginTop="24dp"
            app:errorColor="#9E1313"
            app:helperText=" "
            app:labelText="Label"
            app:maxCharacters="500"
            app:panelBackgroundColor="#0F000000"
            app:primaryColor="#DD000000">

            <studio.carbonylgroup.textfieldboxes.ExtendedEditText
                android:id="@+id/text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="top"
                android:hint="Hint"
                android:inputType="textAutoComplete|textCapSentences|textNoSuggestions|textMultiLine" />

        </studio.carbonylgroup.textfieldboxes.TextFieldBoxes>

    </LinearLayout>

</ScrollView>

Try to paste text at least 10 times.

ako2345 avatar Feb 27 '18 17:02 ako2345

The issue does exist.

When the height exceeds a certain value (varied by but always greater than the screen height), the upper panel disappears. This only happens when it is placed in a scrollable layout (ScrollView, NestedScrollView, etc.) directly or indirectly.

Currently, I cannot determine why that happens. I guess it is caused by the scrolling view mechanism (i.e. refresh the layout when the overall height exceeds some value to save memory).

As a workaround, I suggest you either assign a specific height to the TextFieldBoxes:

android:height="300dp"

or restrict the maximum height of the ExtendedEditText like so:

android:maxHeight="300dp"

To make the field itself scrollable when there're too many words, you can refer here.

Sorry for the bug, hope this solution helps you ;)

HITGIF avatar Feb 28 '18 04:02 HITGIF

Thank you for the answer! I will try to use maxHeight further.

ako2345 avatar Feb 28 '18 09:02 ako2345

When it will be fixed?

jrcacd avatar Feb 20 '19 09:02 jrcacd