palantir / blueprint

A React-based UI toolkit for the web
https://blueprintjs.com/
Apache License 2.0
20.75k stars 2.18k forks source link

Ability to disable onHoverChange event for DateRangeInput #4531

Closed olegshilov closed 3 years ago

olegshilov commented 3 years ago

Environment

Feature request

Hi, I have a small suggestion about date inputs. I can’t find any way to disable changing input value on date range hover right now. Maybe it would be better if onHoverChange behavior can be optional for DataRangeInput. As well as maybe it would be cool to add onHoverChange effect to DateInput where is not working for now

Examples

I think it should be something like this

import { DateRangeInput } from "@blueprintjs/datetime";

<DateRangeInput
  {...}
  shouldChangeOnHover={false}
/>
adidahiya commented 3 years ago

I think this is an intentional choice in the design system and we don't necessarily want to add a prop to customize this behavior without a strong need for it. The hover interaction helps preview what the input will look like once you click on a date.

olegshilov commented 3 years ago

@adidahiya ok, I understood. But what about adding onHoverChange to DateInput?

adidahiya commented 3 years ago

@olegshilov what will you use that for? Can you explain your use case in more detail?

olegshilov commented 3 years ago

As you mentioned above, for example for this (=

The hover interaction helps preview what the input will look like once you click on a date.

adidahiya commented 3 years ago

@olegshilov yes, that "preview" is built into the component behavior already. So I'm asking what would you use the prop for outside the component? It helps to share more context about your use case.