Steps to reproduce:
- enable the dev mode in nuxeo.conf
org.nuxeo.dev=true
- install nuxeo-web-ui
./nuxeoctl mp-install nuxeo-web-ui
- start Nuxeo
- edit the file nxserver/nuxeo.war/ui/nuxeo-web-ui-bundle.html
- add at the beginning, before the first nuxeo-slot-content, the following code
<script type="text/javascript"> function test(foo) { return foo; } </script>
- log in
- navigate to a File document
- put the cursor over the Clipboard icon and observe the tooltip is not displayed
- click on the Clipboard icon and observe the icon is not refreshed to indicate the new state
- in the browser console, you will the following error
Uncaught TypeError: Cannot read property 'contains' of undefined at HTMLElement.toggle (elements.html:49306) at HTMLElement.handler (nuxeo-app.html:2283) at Object._fire (nuxeo-app.html:7171) at Object.forward (nuxeo-app.html:7566) at Object.click (nuxeo-app.html:7529) at HTMLElement._handleNative (nuxeo-app.html:6949)
The problem seems to be that the JS code modifies how the code is loaded and the document is still undefined when some functions are called (like the first call to update for nuxeo-clipboard-toggle-button
If the JS code is put at the end of nxserver/nuxeo.war/ui/nuxeo-web-ui-bundle.html, everything works fine.
Reproduced 9.10 and 10.2 with Chrome, but it probably affects all browsers.
- is related to
-
NXP-25925 Clipboard error when refreshing
- Resolved
-
ELEMENTS-1096 Fix inconsistent rendering of override of a slot content in Chrome
- Resolved
-
ELEMENTS-568 Investigate performance improvements for slot and filter rendering
- Open