Skip to content

Weird sizing of the select element. #666

Closed
@AmaiKinono

Description

@AmaiKinono

I think I've found some strange behavior of the select element, but I'm new to this library (and C++) so please point out if I did anything wrong.

The test is done by creating a new example in Samples/tutorial/. The code is the same as Samples/tutorial/template but a different .rml file is loaded:

<rml>
<head>
    <link type="text/css" href="index.rcss"/>
    <title>Window</title>
</head>
<body>
    <p>Some text.</p>
    <p>Some other text.</p>
    <select>
        <option>Option 1</option>
        <option>Option 2</option>
    </select>
</body>
</rml>

index.rcss:

body {
    font-family: LatoLatin;
    font-weight: normal;
    font-style: normal;
    font-size: 40dp;
    display: block;
}

select, selectvalue, p {
    border-width: 3dp;
    border-color: #fff;
}

div, p
{
    display: block;
}

I'm on Linux and uses the GLFW + GL3 backend. The documents shows like this:

image

Seems the select element doesn't have enough height, and the text is wrapped.

If we use a flexbox for body:

body {
    font-family: LatoLatin;
    font-weight: normal;
    font-style: normal;
    font-size: 40dp;
    display: flex;
    flex-direction: column;
    align-items: center;
}

Then it looks like this:

image

The select element now has little width.

Metadata

Metadata

Assignees

No one assigned

    Labels

    layoutLayout engine issues and enhancements

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions