Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edittext seems to close the parent tag #104

Open
tieskedh opened this issue Oct 23, 2020 · 1 comment
Open

Edittext seems to close the parent tag #104

tieskedh opened this issue Oct 23, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@tieskedh
Copy link
Contributor

The parser seems to close a parent tag for EditText.

FrameLayout {
    EditText()
    View()
}

Will result in:

FrameLayout {
    EditText()
}
View()

Same occurs with LinearLayout.

@tieskedh
Copy link
Contributor Author

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

    <EditText
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:inputType="text"/>
    <View
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>
</FrameLayout>
    @Test
    fun `FrameLayout with EditText and View`() {
        assertAST(
            fileName = "framelayout-edittext-view.xml",
            expected = Layout(
                listOf(
                    FrameLayoutNode(
                        ViewGroupAttributes(
                            listOf(
                                EditTextNode(
                                    ViewAttributes(
                                        width = LayoutSize.MatchParent,
                                        height = LayoutSize.MatchParent
                                    ),
                                    text = "",
                                    inputType = InputType.Text
                                ),
                                ViewNode(
                                    ViewAttributes(
                                        width = LayoutSize.MatchParent,
                                        height = LayoutSize.MatchParent
                                    ),
                                )
                            )
                        ),
                        ViewAttributes(
                            width = LayoutSize.MatchParent,
                            height = LayoutSize.WrapContent,
                        ),
                    )
                )
            )
        )
    }

@pocmo pocmo added the bug Something isn't working label Nov 13, 2020
@pocmo pocmo added this to the Shipping plugin milestone Nov 13, 2020
nordfalk added a commit to nordfalk/recompose that referenced this issue May 6, 2023
nordfalk added a commit to nordfalk/recompose that referenced this issue May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants