Fix `event.path` deprecated on Layer onClickOutside (#6457)
Fix `event.path` deprecated on Layer onClickOutside (#6457)

* Fix event.path deprecated on Layer onClickOutside

* Add optional chaining operator

Co-authored-by: Jessica Filben <dd621d267ba9e43dbaa3157fcb9d8974e2e5b610@users.noreply.github.com>

* Fix composePath to get first target element

Co-authored-by: Jessica Filben <dd621d267ba9e43dbaa3157fcb9d8974e2e5b610@users.noreply.github.com>

Co-authored-by: Jessica Filben <dd621d267ba9e43dbaa3157fcb9d8974e2e5b610@users.noreply.github.com>
grommet/grommet,grommet/grommet,grommet/grommet