Newly created list elements do not appear
See original GitHub issueDescribe the bug
When mapping through list elements, and the list changes after the initial render, the list items are not rendered properly (especially when wrapped inside the Text
component)
To reproduce
Go to the sandbox and paste following code:
const FONT_FAMILY_ROOT = '"Titillium Web", sans-serif';
const SOUND_TYPE_URL = '/assets/sounds/type.mp3';
const audioSettings = { common: { volume: 0.25 } };
const playersSettings = { type: { src: [SOUND_TYPE_URL], loop: true } };
const bleepsSettings = { type: { player: 'type' } };
const animatorGeneral = { duration: { enter: 150, exit: 150, stagger: 40 } };
const Sandbox = () => {
const [activate, setActivate] = React.useState(true);
const [texts, setTexts] = React.useState(["foo", "bar"]);
React.useEffect(() => {
const timeout = setTimeout(() => setTexts([...texts, "another Text"]), 1000);
return () => clearTimeout(timeout);
}, [texts]);
return (
<ArwesThemeProvider>
<BleepsProvider
audioSettings={audioSettings}
playersSettings={playersSettings}
bleepsSettings={bleepsSettings}
>
<StylesBaseline styles={{
body: { fontFamily: FONT_FAMILY_ROOT }
}} />
<AnimatorGeneralProvider animator={animatorGeneral}>
<Animator animator={{ activate }}>
<List>
<li><Text>Lorem ipsum lov sit amet.</Text></li>
<li><Text>Lorem ipsum lov sit amet.</Text></li>
{ texts.map((text, index) => (
<li
key={index}
>
<Text>
{text}
</Text>
</li>
)) }
</List>
</Animator>
</AnimatorGeneralProvider>
</BleepsProvider>
</ArwesThemeProvider>
);
};
render(<Sandbox />);
Expected behavior
List items appear and are rendered correctly
Development environment
Sandbox ( v. 1.0.0-alpha.19 )
Additional Info
One can see that the icons are created (hovering over the not-rendered list elements yields a text-cursor) You can also see the elements with the browser development tools
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
javascript - Why list is not shown on page - Stack Overflow
Your problem was textContent attribute, you need to set the innerText or innerHTML to that a element. Share. Share a ...
Read more >Get started with Lists in Teams - Microsoft Support
On mobile devices, team members can view and edit lists, but not create or add them. ... Added lists appear as tabs along...
Read more >.add() | jQuery API Documentation
Given a jQuery object that represents a set of DOM elements, the .add() method constructs a new jQuery object from the union of...
Read more >Handling dynamically created HTML in JavaScript - Medium
This is possible as the JavaScript is executed immediately after the elements are declared in the DOM — the elements are guaranteed to...
Read more >Document.createElement() - Web APIs | MDN
The nodeName of the created element is initialized with the value of ... Define the new element customElements.define("expanding-list", ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
thanks, that worked!
Hey @InsOpDe !
This bug was recently reported and fixed. It should work fine for the next release.
Thank you for your report!