Blueprint: Date input in dialog, can't pick 1st date of month

Created on 8 Apr 2019  路  3Comments  路  Source: palantir/blueprint

Environment

  • __Package version(s)__: "@blueprintjs/core": "^3.12.0", "@blueprintjs/datetime": "^3.8.0"
  • __Browser and OS versions__: Windows 10, Chrome

Steps to reproduce

  1. Render DateInput inside Dialog
import { Dialog } from '@blueprintjs/core'
import { DateInput } from '@blueprintjs/datetime'

<Dialog>
  <DateInput />
</Dialog>
  1. Pick 1st date

Actual behavior

Date isn't picked

Expected behavior

1st date picked

Possible solution

The source of bug seems to be a function from dateInput.js:214, which adds onBlur event

<Dialog>
  <DateInput
    popoverProps={{
      onOpened: (e) => {
        const el = document.querySelector('.DayPicker-Day[tabindex="0"]')
        el.addEventListener('blur', (e) => {
          e.stopImmediatePropagation()
        })
      },
    }}
  />
</Dialog>
P2 datetime bug help wanted

Most helpful comment

It works for me in @blueprintjs/core: 3.24.0

All 3 comments

The possible solution above does not handle a case in which the user chooses a different month before selecting the 1st. The solution would need to include another handler to stopImmediatePropagation after dayPickerProps.onMonthChange is fired which is currently overwritten here: https://github.com/palantir/blueprint/blob/5a6ccb20257c6963e483e63b156c04e647909558/packages/datetime/src/dateInput.tsx#L183-L186

I had the same problem and it was fixed by updating the version of @ blueprint/core to 3.15.1. Clean the node_modules by outdated nested dependencies

It works for me in @blueprintjs/core: 3.24.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

raiju picture raiju  路  3Comments

giladgray picture giladgray  路  3Comments

adidahiya picture adidahiya  路  3Comments

sunabozu picture sunabozu  路  3Comments

westrem picture westrem  路  3Comments