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

fix(Breadcrumb): Pass rest props to item when not interactive #2798

Merged
merged 6 commits into from
Oct 31, 2023

Conversation

langz
Copy link
Contributor

@langz langz commented Oct 26, 2023

I believe/hope this should fix the reported issue here: https://github.com/dnbexperience/eufemia/pull/2676/files#r1368576095

@langz langz requested a review from tujoworker October 26, 2023 10:01
@vercel
Copy link

vercel bot commented Oct 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
eufemia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 30, 2023 8:39pm

@langz langz force-pushed the fix/breadcrumb-pass-props-to-breadcrumb-item branch from b014b30 to 39808aa Compare October 26, 2023 10:01
@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 26, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5590682:

Sandbox Source
eufemia-starter Configuration

Copy link
Contributor

@thaytharma thaytharma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 😍

Copy link
Member

@tujoworker tujoworker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! And nice tests as well! Sounds also that you not found any issues forwarding such props to the span 🎉

@langz
Copy link
Contributor Author

langz commented Oct 26, 2023

Nice! And nice tests as well! Sounds also that you not found any issues forwarding such props to the span 🎉

I've not looked extensively at this, is there a greater risk of passing props to the span now, than before https://github.com/dnbexperience/eufemia/pull/2676/files#r1368576095?

Maybe we should "filter out" the "button props" to not getting drilled down to the span?

I can take a look tomorrow in our storybook and test the consequences of passing down all button props to the span, and see what happens 🙏

@tujoworker
Copy link
Member

At least will prop reach the span, that should potentially not: variant !== 'current'. But we can make this "safe" by only allowing valid HTML attributes to be forwarded. E.g. if they contain a dash.

@tujoworker
Copy link
Member

tujoworker commented Oct 26, 2023

We may add the filterProps addition #2802 – I have a commit (+ test) ready locally and can push it after a rebase.

@langz
Copy link
Contributor Author

langz commented Oct 27, 2023

Perfect, thanks!
I’ll continue with this after todays morning meetings

@langz
Copy link
Contributor Author

langz commented Oct 27, 2023

Maybe we should add a comment, or add this PR to a list of things we probably can remove in the next breaking change/release?
Reason being, is because I'm not sure if this feature is really needed, or if it's just to be able to pass down data-testid's.

I think it's fair that we now add it back to a v10 release for now, as we introduced sort of a "breaking change" by removing this in https://github.com/dnbexperience/eufemia/pull/2676/files#r1368576095 as part of a minor release. But in v11, maybe it's okay to remove it, and document it, as I think it's only used for passing down data-testid's for now, which maybe is not a good enough reason to have it? 🤔

@tujoworker
Copy link
Member

Yes, I agree.

@langz langz force-pushed the fix/breadcrumb-pass-props-to-breadcrumb-item branch from a5ca1ca to 8220d5d Compare October 27, 2023 13:12
@langz
Copy link
Contributor Author

langz commented Oct 27, 2023

I've added a few commits:

And believe this should be good to go now 🙏

@tujoworker tujoworker merged commit 72de227 into main Oct 31, 2023
7 checks passed
@tujoworker tujoworker deleted the fix/breadcrumb-pass-props-to-breadcrumb-item branch October 31, 2023 08:55
tujoworker pushed a commit that referenced this pull request Nov 3, 2023
## [10.11.0](v10.10.0...v10.11.0) (2023-11-03)

### ✨ Features

* **breakpoints:** media query mixin offset options ([#2773](#2773)) ([d0c4c6d](d0c4c6d))
* **Dropdown:** add Drawerlist theme for Sbanken ([#2649](#2649)) ([3a69d7c](3a69d7c))
* **FormLabel:** rewrite to TypeScript ([#2818](#2818)) ([2b3e419](2b3e419))
* **forms:** add autocomplete (autofill) support ([#2811](#2811)) ([342556c](342556c))
* **forms:** add Norwegian translation to country list ([#2814](#2814)) ([6073ab7](6073ab7))
* **forms:** reset `sessionStorageId` on submit ([#2812](#2812)) ([cbbd9e5](cbbd9e5))
* **PaymentCard:** add styling for other card statuses ([#2777](#2777)) ([#2822](#2822)) ([195b083](195b083))
* **SASS:** add allBetween media query breakpoint mixin ([#2779](#2779)) ([1c8e8ef](1c8e8ef))
* **Section:** add responsive props: breakout, outline, cornerRadius, backgroundColor, textColor and innerSpace ([#2791](#2791)) ([ed3ca99](ed3ca99))
* **skip-link:** sbanken styling ([#2785](#2785)) ([f6d9ea3](f6d9ea3))
* **Space:** add innerSpace prop with media query breakpoints support ([#2790](#2790)) ([3dffb90](3dffb90))
* **Upload:** singular texts when uploading single file ([#2783](#2783)) ([cbf1cb9](cbf1cb9))

### 🐛 Bug Fixes

* **Anchor:** position icon left with target blank sbanken ([#2797](#2797)) ([d2d1779](d2d1779))
* BreadcrumbItem when using to and element props ([#2813](#2813)) ([e7eff2d](e7eff2d))
* **Breadcrumb:** Pass rest props to item when not interactive ([#2798](#2798)) ([72de227](72de227)), closes [/github.com//pull/2676/files#r1368576095](https://github.com/dnbexperience//github.com/dnbexperience/eufemia/pull/2676/files/issues/r1368576095)
* **FieldBlock:** add asFieldset property to force use fieldset/legend ([#2780](#2780)) ([bd1faed](bd1faed))
* **FieldBlock:** fix alignment issue when element is fieldset ([#2786](#2786)) ([544424b](544424b))
* **forms:** enhance accessibility by using toggle buttons ([#2781](#2781)) ([aee0113](aee0113))
* **forms:** fix Form.Element type ([#2796](#2796)) ([0b5dfa7](0b5dfa7))
* **forms:** Selection accessibility enhancement by using toggle buttons ([#2795](#2795)) ([6bc6062](6bc6062))
* **forms:** Support undefined in toggle and button fields ([#2775](#2775)) ([a22fad5](a22fad5))
* **GlobalStatus:** remove paragraph tag around title to allow children paragraphs ([#2800](#2800)) ([c0657bb](c0657bb))
* **NumberFormat:** show em dash instead of NaN ([#2784](#2784)) ([ca65f4a](ca65f4a))
* **NumberMask:** as_number should default to locally given decimalSymbol ([#2810](#2810)) ([833f422](833f422))
* **PhoneNumber:** fix spacing prop support ([#2815](#2815)) ([c57e7d1](c57e7d1)), closes [#2807](#2807)
* **TypeScript:** fix Grid and Flex export ([#2819](#2819)) ([5316fc0](5316fc0))
* **TypeScript:** make dynamic element prop compatible with e.g. Styled Component elements ([#2778](#2778)) ([8a6b766](8a6b766))
* **useMedia:** enhance SSR support by setting state during component mount ([#2774](#2774)) ([d72aa2b](d72aa2b))

### 📝 Documentation

* display anchors with icons using Anchor's icon prop ([#2801](#2801)) ([57e75ac](57e75ac))
* **FieldBlock:** removes excessive properties header ([e5d9cbe](e5d9cbe))
* **FieldBlock:** removes excessive properties header ([#2788](#2788)) ([bb739ea](bb739ea))
* **FormSet:** spelling in deprecation docs ([#2827](#2827)) ([1bcbf60](1bcbf60))
* **PaymentCard:** sets card_number as required ([#2841](#2841)) ([b58978e](b58978e))
@tujoworker
Copy link
Member

🎉 This PR is included in version 10.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants