Closed dimapaloskin closed 3 years ago
So I can see that x-overlay has own tricky logic, so my PR need works :)
@jarek-foksa if we are will change .remove
to .style.visibility = 'hidden'
it can has unexpected side-effects?
Yes, it is going to break things. Note that <x-overlay>.show()
takes care of correct positioning of the overlay and prevents document from being scrolled. Ideally the overlay should be kept inside the shadow DOM of <x-select>
, but this turned out to make it impossible to position it correctly, so I had to resort to the current hackish solution where I'm inserting the overlay before <x-select>
temporarily.
Is this how all frameworks that use virtual DOM behave? I.e. do they break when elements are added to or removed from the rendered DOM tree by means other than the framework-specific render
method?
Not sure about other frameworks. Unfortunately I couldn't to make friends with xel
and create-react-app
(also create-preact-app
). Will test it.
There are very strange things.
I tried few boilerplates with xel (I did setup it based on Setup
instructions) and with each boilerplate I can see infinity bundle loading:
Gif
Any ideas why it happens?
Yes, it is going to break things. Note that
.show() takes care of correct positioning of the overlay and prevents document from being scrolled.
Is my PR breaking this functionality?
It's just set visibility = hidden
to overlay, instead really removing it from DOM.
If you just replace this.remove()
with this.style.visibility = "hidden"
in <x-overlay>.close()
then the overlay might make some other widgets non-clickable even after it has been closed. You should probably use this.style.display = "none"
instead.
I haven't made the final decision yet, but I'm thinking about focusing this project exclusively on vanilla HTML/DOM/JS/CSS development. This would mean I would ignore any bugs that can be reproduced only with some specific framework.
If you just replace this.remove() with this.style.visibility = "hidden" in
.close() then the overlay might make some other widgets non-clickable even after it has been closed. You should probably use this.style.display = "none" instead.
Make sense. Will try it.
I haven't made the final decision yet, but I'm thinking about focusing this project exclusively on vanilla HTML/DOM/JS/CSS development. This would mean I would ignore any bugs that can be reproduced only with some specific framework.
Ok :)
Since Xel 0.9.0 is now dual-licensed under GPLv3 and commercial license I won't be able to accept pull requests anymore. If you can still reproduce the original issue, please report it on https://xel-toolkit.org/issues.
Current version сauses error after first select.
I tested it with hypperapp, but I think it is rightly for react too.
This happens because
x-overlay
is removed from real DOM by.hide
method, so renderer lost reference on real node.This PR should fix this problem.
What do you think about it?