dropEffect for drag&drop in vaadin-grid

Hi,

I try to add a dropEffect to the drag&drop functionality of vaadin-grid but I can’t find any possibility to set this property on any event and I can’t find anything in the documentation related to this.

Hi, there’s no proper API for managing the drop effect unfortunately but something like this could be used as a workaround:

const listener = (event) => {
  const { item } = grid.getEventContext(event);
  if (item.name === '0') {
    event.dataTransfer.dropEffect = 'link';
  }
};
grid.addEventListener('dragover', listener, true);

Hi,

I don’t think this is working because vaadin-grid-drag-and-drop-mixin.js is already placing a dragover listener on the table element inside of vaadin-grid and call stopPropagation, so it will never reach my listener if I’m correct. But yeah, access to event of dragover would be all i need.

The example should work because of the true passed as the last parameter in the event registration (capture phase)

Oh, i have overseen that last parameter, looks indeed promising, thank you very much :slight_smile: