easepick / easepick

Date range picker. Uses Shadow DOM, lightweight size, no dependencies.
https://easepick.com
Other
549 stars 52 forks source link

onMouseLeave on the Calendar can deselect selections #194

Open megasmack opened 1 year ago

megasmack commented 1 year ago

Describe the bug When you're repicking dates and onMouseLeave is run with repick: true and autoApply: false, your calendar selection will reset.

To Reproduce Steps to reproduce the behavior:

  1. Using the following options:
    {
    element: "#checkin",
    css: [
        "https://cdn.jsdelivr.net/npm/@easepick/bundle@1.2.1/dist/index.css"
    ],
    zIndex: 10,
    autoApply: false,
    RangePlugin: {
        elementEnd: "#checkout",
        repick: true
    },
    plugins: [
        "RangePlugin"
    ]
    }
  2. Select a date range and then apply.
  3. Repick a date range without clicking apply.
  4. Mouse out of the calendar and the date selections disappear.

Expected behavior Mouse out of the calendar should keep date selections if until "apply" is clicked.