web-components-examples icon indicating copy to clipboard operation
web-components-examples copied to clipboard

expanding-list-web-component err

Open THINKING-REEDs opened this issue 5 years ago • 1 comments

When I switch from Google's English to Chinese; const nextul = e.target.nextElementSibling; The value of nextul is null and cannot be expanded.

THINKING-REEDs avatar Jul 31 '20 08:07 THINKING-REEDs

Google translate adds elements to the dom, which interrupts the functionality of the web component in this instance (from a quick test it appears to add <font> elements).

To fix this de-coupling the javascript from the dom elements (ie using classes/ids instead) would be needed.

Rumyra avatar May 06 '22 10:05 Rumyra