vaadin-component-factory / vcf-date-range-picker-flow

Date Range Picker Flow component
4 stars 2 forks source link

The Feature "removePresetByIds" is not working #45

Open kPlock opened 4 months ago

kPlock commented 4 months ago

We use the DateRangePicker with Sidebar enabled. We want to hide the "original" Buttons and we add our own, but the removing is not working anymore:

Sample code:

Bildschirmfoto 2024-02-14 um 14 21 48

Result:

Bildschirmfoto 2024-02-14 um 14 21 30
HerbertsVaadin commented 4 months ago

Seems like there's an issue with the js component. THIS line should be executed when dialog / overlay is opened or closed it seems, but it only gets executed when closing.

HerbertsVaadin commented 4 months ago

Workaround CSS to remove / hide all presets

vcf-date-range-picker-overlay-content::part(today-button),
vcf-date-range-picker-overlay-content::part(preset-button),
vcf-date-range-picker-overlay-content::part(cancel-button) {
    display: none;
}

But for our case, we want to remove only the 'yesterday' preset, which requires to put the CSS in frontend/themes/mytheme/components/vcf-date-range-picker-overlay-content.css

:host vaadin-button#yesterdayButton {
    display: none;
}