fork-tongue / collagraph

Collagraph 📓 Reactive user interfaces

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DomRenderer skips certain tags

ivoflipse opened this issue · comments

Given the following snippet:

<div class="select">
    <select>
      <option>A</option>
      <option>B</option>
      <option>C</option>
    </select>
  </div>

which renders as follows:
image
image

If I put the snippet inside a tag in a cgx file it renders like this:
image
image

The select tag is somehow skipped. Any ideas on what could be causing this?

Wow: apparently, an (empty) <select> dom element is a 'Falsey' object, so checks like: if fiber.dom don't work as expected... Fix upcoming in the dom-renderer branch.

Wow: apparently, an (empty) <select> dom element is a 'Falsey' object, so checks like: if fiber.dom don't work as expected... Fix upcoming in the dom-renderer branch.

Can't you implement __bool__ on VNode or Fiber? Or is fiber.dom an actual browser Element? In that case... I see this in my console:

image

You might also prefer to stick with what you already committed now. I'm just proposing this as an alternative for your consideration.

The fiber.dom is a javascript object wrapped in Python. So I think that there might be something going on in the Python wrapper which makes the select element evaluate to False.