When keyboard focus is on the last element of the modal, using Shift+Tab to navigate to the previous focusable element does not work as intended. Focus is stuck in a loop between last and first focusable element if Shift+Tab is used.
Navigate to the "Next" button with keyboard. Use Shift+Tab to navigate to previous element.
The intended behaviour is focus on the "Cancel" button but it moves to the "X" (close) button. On clicking Shift+Tab again, you move to the Next Button (This is the right action)
Expected Behaviour
Focus should shift to previous focusable element when trying to use Shift+Tab from the last focusable element.
When keyboard focus is on the last element of the modal, using Shift+Tab to navigate to the previous focusable element does not work as intended. Focus is stuck in a loop between last and first focusable element if Shift+Tab is used.
Steps to reproduce
Open the Slider in https://freshworks-nucleus.netlify.com/docs/components/nucleus-modal
Navigate to the "Next" button with keyboard. Use Shift+Tab to navigate to previous element.
The intended behaviour is focus on the "Cancel" button but it moves to the "X" (close) button. On clicking Shift+Tab again, you move to the Next Button (This is the right action)
Expected Behaviour
Focus should shift to previous focusable element when trying to use Shift+Tab from the last focusable element.