[Lens] setFocusTrap after animation is ended and not with timeout #101148
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #100653
@flash1293 you were suspecting that the line with
setTimeout
causes the problem, but that was actually solution to it, just not fixing all the cases. For some reason EuiFocusTrap messes up the animation when the element has aposition: absolute
. I am not sure what styles it modifies, didn't look enough to find a low-level root cause (I did spend some time on it, but I failed to figure it out).But I think we can ensure to avoid the animation problem with running the callback function not in timeout function, but on the callback
onAnimationEnd
.EDIT: I just realized we have an advanced setting about not using animations at all, I'll see if we should solve it differently in this case. EDIT 2: Still works correctly even with animations off.