bpmn-io / bpmn-js-properties-panel

A properties panel for bpmn-js.
MIT License
293 stars 196 forks source link

Input parameters not working inside a web component #458

Closed simeon-penev closed 3 years ago

simeon-penev commented 3 years ago

Describe the Bug

The input parameters cannot be opened inside a webcomponent, because 'min-dom' is using document and not document.body..shadowDom

The error occurs in InputOutputParameter.js:77 because entryNode is null:

  result.setOpen = function(value) {
    var entryNode = domQuery('[data-entry="' + collapsible.id + '"]');
    collapsible.setOpen(value, entryNode);
  };

Steps to Reproduce

  1. Build the properties panel inside a web component and add 2 input parameters.
  2. Try to open one of the input parameters from the icon 'arrow' on the left side.
  3. Error is shown in the console

Expected Behavior

The input parameters can be edited inside a web component.

Environment

nikku commented 3 years ago

@simeon-penev What would be the exact fix to make it shadow DOM and DOM compatible? Do you mind contributing a fix?

domQuery supports a second, context parameter like so: domQuery('.some-selector', someDiv)

simeon-penev commented 3 years ago

@nikku Thanks for the suggestion, just posted the pull-request #460