-
Notifications
You must be signed in to change notification settings - Fork 842
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
[EuiInnerText] Returns empty string inside EuiPopover
#5247
Comments
Tracked it down to (the somewhat obvious) eui/src/components/popover/_popover.scss Line 41 in 3d9a593
Unsure how to resolve yet. |
Unlike https://codesandbox.io/s/7dhmm?file=/index.html (may need to refresh the codesandbox iframe or view in new window, JS is being finicky) This means even though we set Alternatively, another point to consider: do we need the visibility property in the first place? Or will just opacity suffice in terms of animating the popover in? |
This is where I went, also. eui/src/components/popover/popover.tsx Lines 436 to 439 in 3d9a593
I'm going to try your other suggestion, also |
++, if there isn't a specific reason we're animating/toggling visibility (accessibility or similar), I think it makes the most sense to animate only opacity. |
a11y is the only thing I can think of, because |
Right, but arguably that's better experience that screen readers get to focus immediately into the popover even though they can't see it - does a visual fade-in animation really need to delay non or low-sighted users? |
I'm testing with VoiceOver now in local vs production (specifically data grids and forms in popovers) and not seeing a noticeable issue with removing |
EuiInnerText
returns an empty string forinnerText
(node contents) when used withinEuiPopover
.The
ref
is correctly set and the node does in fact have content, butnode.innerText
returns empty.node.textContent
, however, correctly returns the content string. Giveneui/src/components/inner_text/inner_text.tsx
Lines 29 to 36 in 3d9a593
we accept the empty string over the content string.
There are important differences between the two methods, most notably that
and
It's likely that while
EuiPopover
is opening (and at the time the node is evaluated) some style or attribute is marking the node as hidden or not human-readable.innerText
has the correct content insideEuiPopover
if delayed until after the popover is stable open.Repro: https://codesandbox.io/embed/cold-currying-tpfgf?fontsize=14&hidenavigation=1&theme=dark
The text was updated successfully, but these errors were encountered: