Problem with layout of custom field in custom field

I have custom field containg grid layout with some fields. One of them is
AbstractField
. All works fine, when this field is just
CheckBox
(see

checkbox.png

), but when it is a
custom field
with the only one checkbox, the field is displayed
under
the rest of components (see

customFieldWithCheckbox.PNG

).
I use following code

    public static class MyAddressField extends AddressField {
        
        @Override
        protected AbstractField<Boolean> createCheckbox() {
//            return new CheckBox();
            return new CustomField<Boolean>() {

                @Override
                public Class<? extends Boolean> getType() {
                    return Boolean.class;
                }

                @Override
                protected Component initContent() {
                    return new CheckBox();
                }
            };
        }
        
    }

Where can be problem and how to fix it?
Thanks in advance for any help.

Agata
19046.png
19047.png

Try to define a fixed or undifined size for the CustomField. IIRC it by default has some relative size that may cause weird issues.

cheers,
matti

So easy. Thank you :slight_smile: