How to align fields created by createInputDialog

Hello, is is possible to align new fields that was created by createInputDialog?
I tried setAlignment, but with no use. Is there any way how to reposition them?
Thank you!

dialogs.createInputDialog(this)
    .withParameters(
        InputParameter.parameter(PARAMETER_PERIOD_FROM)
            .withField(() -> {
                DatePicker<Date> periodFromDateField = uiComponents.create(DatePicker.class);
                periodFromDateField.setRequired(true);
                periodFromDateField.setAlignment(Component.Alignment.TOP_LEFT);
                return periodFromDateField;
            }),
        InputParameter.parameter(PARAMETER_PERIOD_TO)
            .withField(() -> {
                DatePicker<Date> periodToDateField = uiComponents.create(DatePicker.class);
                periodToDateField.setRequired(true);
                periodToDateField.setAlignment(Component.Alignment.TOP_RIGHT);
                return periodToDateField;
            }),
    )

image

Hello!

InputDialog places all fields into the Form component. And this is how by default DatePicker looks in the Form.

I can suggest you to use dateParameter or DateField instead. Or create Screen with custom layout.

@pinyazhin Thank you, it helped!