slimjs / slim.js

Fast & Robust Front-End Micro-framework based on modern standards

Home Page:http://slimjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Evaluate bindings in shadow dom

ThatScalaGuy opened this issue · comments

commented

Hi,
I am wondering if it is possible to evaluate the bindings when using a shadow dom.

The attached fiddle shows what I want to achieve.

http://jsfiddle.net/wmoL2v81/13/

Or is this not possible with slim.js

Basically, it is possible, adding a slim plugin.

Something like

Slim.plugin('create', (element) => {
  const children = Array.from(element.children);
  requestAnimationFrame( () => {
  element._bindChildren(children);
  element.commit();
  });
});

If you want to restrict for specific elements, in the plugin function filter the elements by their localName... if (element.localName === 'my-custom-tag') ...

Will that work for you?

commented

Did not see your replay. I will check your recommendation next week. Thx so far.