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

Add a reset button to the filters #285

Open
JonasKellerer opened this issue Nov 12, 2024 · 2 comments
Open

Add a reset button to the filters #285

JonasKellerer opened this issue Nov 12, 2024 · 2 comments
Assignees
Labels
frontend Changes to the frontend

Comments

@JonasKellerer
Copy link
Contributor

This came up in #270

It would be nice to have a button at the top of the filters which removes all inputs from the filters and inserts default values.

@JonasKellerer
Copy link
Contributor Author

As discussed:

  • we need to control the input components from the outside for this ticket (which is currently not possible)
  • we first create a proof of concept of an external control and discuss this
  • then we go back to this ticket

@JonasKellerer
Copy link
Contributor Author

Search in MDN:

<input type="date" value="2022-01-01">: "You can set a default value for the input with a date inside the value attribute, like so"

  • This sets the initial value of the field.
  • The field then controls itself, meaning users can input new dates.
  • The value can be accessed from the outside of the element
<label for="start">Start date:</label>
<input type="date" id="start" name="trip-start" value="2018-07-22" min="2018-01-01" max="2018-12-31" />

var startDateInput = document.getElementById('start');
var startDateValue = startDateInput.value

<input type="text"> : "The value attribute is a string that contains the current value of the text entered into the text field. You can retrieve this using the HTMLInputElement value property in JavaScript."

<select> : Has no value prop. The default/value is set directly on the options: Dog

Proposal for GsDateRangeSelector:

<gs-date-range-selector
    dateRangeOptions='[{ "label": "Year 2021", "dateFrom": "2021-01-01", "dateTo": "2021-12-31" }]'
    earliestDate="1970-01-01"
    value="Year 2021"
    width="100%"
    dateColumn="myDateColumn"
></gs-date-range-selector>
  • use value similar to input of type text
  • sets the initial value of the component
  • the input can still be controlled by users
  • when a new value is passed to the component, the component uses this value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Changes to the frontend
Projects
None yet
Development

No branches or pull requests

2 participants