New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How to show/hide elements without display: none #93
Comments
Ok, I agree that there should be a support for element place – I'll add that. |
Added now in v3.8.0! 😉 Thank you for the idea! 😎👍 |
Thank you so much. |
Sure, that should also be possible – give me a few hours, our baby just woke up 🍼👶 |
Ok, i understand. Thanks you again. 😄 |
I started to create Node array support, however since
|
I will probably add support for mounting elements with multiple nodes, since it has been requested for |
protip: you can combine this.mylist = place(list.extend('.mylist', MyItem, '_id', { i18n }));
...
this.mylist.update(visible, data);
|
Maybe useful, but not for this...? Because container (div element) still exist with A little question. place() currently doesn't support this? place(
el(".first"),
el(".second")
) Sorry for the inconvenience... |
No, the issue is that You could however create your own custom component to support showing/hiding multiple Nodes. |
Ok, understand. Another one question. Steps to reproduce. const {
el,
mount,
place
} = redom
this.el = el("",
el(".first", "First"),
this.place = place(el(".second", "Second")),
el(".third", "Third")
)
mount(document.body, this.el)
this.place.update(true)
this.place.update(false)
this.place.update(true) Result: <div>
<div class="first">First</div>
<div class="third">Third</div>
<div class="second">Second</div>
</div> |
Thanks for letting know, there was a bug which is now fixed! 💪 |
Lines 32 to 33 in 44f055f
if it's changed to false, it replaces the element with the placeholder again: Lines 51 to 52 in 44f055f
(the third value of The placeholder is just an empty text node: Line 14 in 44f055f
😉 |
Thanks for this detailed answer. |
I'm happy to hear that! I use RE:DOM daily in my own projects (also client work), in production as well. It's powering for example a digital signage platform both in manager and players. Performance and memory-efficiency are top priority, since we're using low-end devices as well. And RE:DOM's been doing quite all right 😉 |
For example, simple form with input fields, which depends on some user actions.
I'm not sure that inserting all of this inputs with
display: none
to page is a good idea.I know about
place
, but create components for each single elements (like an input element) is not a best solution.And now we're returning to this issue.
How to show/hide inputs with id 2-4?
display: none/block
?this.input.style.display = "none/block"
- use it every time when i want to display/hide it?place
withoutdiv
(or any other) container.Here
div
container not needed, but i don't know how to add this inputs without it.Thanks for answer.
The text was updated successfully, but these errors were encountered: