fix(button): forward __next__ Button ref to DOM element#8024
fix(button): forward __next__ Button ref to DOM element#8024tamas-sage wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
@tamas-sage, apologies the ticket hasn't captured the change to the requirements here. I think a better approach is to make a breaking change on the next button and change the ref to point to the underlying DOM element instead of the handle it has currently. Happy to chat on slack if you want to ping me and we can update the ticket if needed
Thanks, that makes sense, I’ve updated this PR to use a breaking change on next Button so the ref now points to the underlying DOM element (instead of an imperative handle). I’ve also updated the PR description/title to reflect that. |
edleeks87
left a comment
There was a problem hiding this comment.
Nice one @tamas-sage, when we merge we should squash/rebase so just this commit and its message is left. We'll also need to add the BREAKING CHANGE comment to the commit so we trigger a major release etc
ae2462b to
b3c0291
Compare
BREAKING CHANGE: __next__ Button no longer exposes ButtonHandle.focusButton().
b3c0291 to
6d75c23
Compare
b01489e
b01489e to
d3157c3
Compare
Proposed behaviour
Button/next now forwards its ref to the underlying DOM element (button / a) instead of exposing an imperative handle.
This aligns with Dialog/FocusTrap expectations for focusFirstElement and prevents the runtime error when opening the dialog.
Current behaviour
Button/next exposed an imperative handle (focusButton) via ref.
When this was passed to focusFirstElement, FocusTrap expected an HTMLElement-compatible value and opening the dialog could throw a “failed to execute” error.
Checklist
d.tsfile added or updated if requiredQA
Additional context
Testing instructions