telerik / kendo-react

Issue tracker - KendoReact http://www.telerik.com/kendo-react-ui/
https://kendo-react-teal.vercel.app
Other
209 stars 36 forks source link

Grid editing="date" is not opening the dropdown #1304

Open InaGlushkova opened 2 years ago

InaGlushkova commented 2 years ago

The Grid with editing="date" should open the DaterangePicker dropdown. The dropdown can not be opened because we are exiting the editing mode.

An example of the issue can be found here: https://www.telerik.com/kendo-react-ui/components/grid/editing/editing-in-cell/ https://stackblitz.com/edit/react-gyb3dh?file=app/main.jsx

A workaround is to control the editing mode: https://www.telerik.com/kendo-react-ui/components/grid/editing/editing-inline/ https://stackblitz.com/edit/react-mskuyg?file=app/main.jsx

WissamProgress commented 1 year ago

Reported it Ticket ID: 1597275

WissamProgress commented 1 year ago

Also reported it Ticket ID: 1603107

WissamProgress commented 1 year ago

Since the DatePicker button triggers the blur event, and therefore props.exitEdit is executed inside the RowRender function, you can fire the exitEdit method only when the button is not clicked:

let flag = false;
const trProps = {
    ...props.tr.props,
    onClick: (e) => {
      if (e.target.classList.contains('k-button-icon')) {
        flag = true;
      }
    },
    onBlur: () => {
      !flag && props.exitEdit();
    },
  };

https://stackblitz.com/edit/react-xvf943?file=app%2Frenderers.jsx