Skip to content
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

[Bug]: Tab content slot calls ref with reserved space element #30902

Open
2 tasks done
NotWoods opened this issue Mar 28, 2024 · 0 comments · May be fixed by #31775
Open
2 tasks done

[Bug]: Tab content slot calls ref with reserved space element #30902

NotWoods opened this issue Mar 28, 2024 · 0 comments · May be fixed by #31775

Comments

@NotWoods
Copy link
Member

Library

React Components / v9 (@fluentui/react-components)

System Info

n/a

Are you reporting Accessibility issue?

no

Reproduction

https://stackblitz.com/edit/2ftonu?file=src%2Fexample.tsx

Bug Description

function tabRef(element) {
  console.log(element);
}

const Example = () => <Tab content={{ ref: tabRef }}>Hello</Tab>

(I couldn't get stack blitz to render anything on screen, but the above code is a minimum repro for the bug)

Actual Behavior

Both <span class="fui-Tab__content ... and <span class="fui-Tab__content-reserved-space ... are logged to console, despite using a single stable callback ref.

Expected Behavior

I expect a ref for the content slot to only reference the content element.

Only the content slot ref should be passed in to the callback, not the reserved space ref. Only <span class="fui-Tab__content ... should be logged.

(We can work around this by turning off reserved space but this behavior is confusing)

Logs

No response

Requested priority

Low

Products/sites affected

Microsoft Loop

Are you willing to submit a PR to fix?

no

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants