Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(atomic): clear min/max for atomic-timeframe-facet when clearing filters #4240

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ export class FacetDateInput {
this.start = range ? parseDate(range.start).toDate() : undefined;
this.end = range ? parseDate(range.end).toDate() : undefined;
}
public componentDidUpdate() {
if (!this.startRef.value && !this.endRef.value) {
this.startRef.min = this.min || this.formattedDateValue('1401-01-01');
this.endRef.max = this.max || '';
this.startRef.max = this.max || '';
this.endRef.min = this.min || '';
}
}

private apply() {
if (!this.startRef.validity.valid || !this.endRef.validity.valid) {
Expand Down Expand Up @@ -138,7 +146,7 @@ export class FacetDateInput {
placeholder={placeholder}
pattern={pattern}
required
min={this.min || this.formattedDateValue(this.start)}
min={this.formattedDateValue(this.start) || this.min}
max={this.max}
value={this.formattedDateValue(range?.end)}
onInput={(e) =>
Expand Down
Loading