question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[TextInputLayout] Invisible box outline on empty text and Suffix ruining box

See original GitHub issue

Description: Box outline doesn’t appear when focused with empty text : Unfocused Screenshot 2020-11-22 113239 Focused Screenshot 2020-11-22 113326 Focus with text Screenshot 2020-11-22 115504 Also in errors Screenshot 2020-11-22 113452

Another issue is that suffixes and trailing icons overlap the stroke: Screenshot 2020-11-22 113503 And my calendar’s trailing icon disappears on error even though it’s still clickable Screenshot 2020-11-22 115121

Expected behavior: For the outline to appear even with empty text and errors. And my trailing icon to still be visible on error.

Source code: A snippet of one of my fields:

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/add_diameter_lay"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="16dp"
                android:layout_marginEnd="16dp"
                android:layout_marginTop="16dp"
                android:hint="@string/tree_diameter"
                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@id/add_height_lay"
                app:suffixText="@string/meter">
                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/add_diameter"
                    android:textAlignment="center"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="numberDecimal"
                    android:textSize="14sp"
                    android:imeOptions="actionDone"/>
            </com.google.android.material.textfield.TextInputLayout>

Android API version: API 29

Material Library version: ‘com.google.android.material:material:1.2.1’

Device: Pixel 2 api 30 emulator and my HTC 10 android 8.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
LukaKitcommented, Dec 11, 2020

@Doomski99 I had the same issue and fixed it with the help of this answer: https://stackoverflow.com/questions/64596156/boxstroke-with-material-outline-box-doesn´t-work

Basically, you should check if you’re setting “android:background” in your main style, because the OutlineBox will use that value for the container border. And because the Activity background is the same color, you can’t see anything.

1reaction
offvanHooijdonkcommented, Nov 1, 2021

Really, is that a “Fixed” ?? I need to have a black background, and now my TextInoutLayout is invisible without text just because… WHY? And no way to override this color, are you serious?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does my TextInputLayout's outLine box doesn't appear?
i want to wrap my edit text with outline ...
Read more >
Transparent Box Above The Task Bar
Hello, I have been getting a transparent box above my task bar. Which makes that region unclickable. I am unable to find any...
Read more >
mozilla-central: pushlog
Skip four bytes when we hit a zero length box, r=kentuckyfriedtakahe ... Bug 1134126 - add 'alt text' for the empty link using...
Read more >
Support for DHCPv6 (RFC 3315) [36949085] - Issue Tracker
Android does currently not support DHCPv6 as defined by RFC 3315. This results in an incomplete IPv6 implementation, as it will not act...
Read more >
Notes, Lists, To-do, Reminders v2.0 (0024) (Pro).apk
Submit malware for free analysis with Falcon Sandbox and Hybrid Analysis technology. Hybrid Analysis develops and licenses analysis tools to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found