vaadin / web-components

A set of high-quality standards based web components for enterprise web applications. Part of Vaadin 20+
https://vaadin.com/docs/latest/components
463 stars 83 forks source link

[form-layout] Fields do not align when colspan is used with form-items #1072

Open emarc opened 5 years ago

emarc commented 5 years ago

In a form with form-items wrapping two regular text-fields and one with colspan="2", the fields do not align at a specific width (about 10px before responsive wrapping).

Gif: https://d.pr/i/B1r816

<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/vaadin-form-layout/src/vaadin-form-item.html">
<link rel="import" href="bower_components/vaadin-form-layout/src/vaadin-form-layout.html">
<link rel="import" href="bower_components/vaadin-text-field/src/vaadin-text-field.html">

<dom-module id="form-test">
    <template>
        <div style="padding:13px">
            <vaadin-form-layout style="width: 100%;">
                <vaadin-form-item>
                    <label slot="label">First Name</label>
                    <vaadin-text-field class="full-width"></vaadin-text-field>
                </vaadin-form-item>
                <vaadin-form-item>
                    <label slot="label">Last Name</label>
                    <vaadin-text-field class="full-width"></vaadin-text-field>
                </vaadin-form-item>
                <vaadin-form-item colspan="2">
                    <label slot="label">Email</label>
                    <vaadin-text-field class="full-width"></vaadin-text-field>
                </vaadin-form-item>
            </vaadin-form-layout>
        </div>
    </template>

    <script>
        class FormTest extends Polymer.Element {
            static get is() {
                return 'form-test';
            }
        }
        customElements.define(FormTest.is, FormTest);

    </script>
</dom-module>
web-padawan commented 2 years ago

The issue is still valid. Can be reproduced by adding width: 645px to the div in the above example:

form-colspan