Skip to content

fix(breadcrumbs): color attribute shows on DOM for Vue #27068

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

Merged
merged 3 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ ion-breadcrumb,part,native
ion-breadcrumb,part,separator

ion-breadcrumbs,shadow
ion-breadcrumbs,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,false
ion-breadcrumbs,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
ion-breadcrumbs,prop,itemsAfterCollapse,number,1,false,false
ion-breadcrumbs,prop,itemsBeforeCollapse,number,1,false,false
ion-breadcrumbs,prop,maxItems,number | undefined,undefined,false,false
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/breadcrumbs/breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class Breadcrumbs implements ComponentInterface {
* Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`.
* For more information on colors, see [theming](/docs/theming/basics).
*/
@Prop() color?: Color;
@Prop({ reflect: true }) color?: Color;

/**
* The maximum number of breadcrumbs to show before collapsing.
Expand Down
4 changes: 4 additions & 0 deletions packages/vue/test/base/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ const routes: Array<RouteRecordRaw> = [
path: '/components',
component: () => import('@/views/Components.vue'),
},
{
path: '/components/breadcrumbs',
component: () => import('@/views/Breadcrumbs.vue')
},
{
path: '/components/select',
component: () => import('@/views/Select.vue')
Expand Down
53 changes: 53 additions & 0 deletions packages/vue/test/base/src/views/Breadcrumbs.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<template>
<ion-page>
<ion-header>
<ion-toolbar>
<ion-title>Breadcrumbs</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<h1>Default</h1>
<ion-breadcrumbs id="default">
<ion-breadcrumb href="#"> Home </ion-breadcrumb>
<ion-breadcrumb href="#electronics"> Electronics </ion-breadcrumb>
<ion-breadcrumb href="#photography"> Photography </ion-breadcrumb>
<ion-breadcrumb href="#cameras"> Cameras </ion-breadcrumb>
<ion-breadcrumb href="#film"> Film </ion-breadcrumb>
<ion-breadcrumb> 35 mm </ion-breadcrumb>
</ion-breadcrumbs>
<hr />
<h1>Color: Danger</h1>
<ion-breadcrumbs id="color" color="danger">
<ion-breadcrumb href="#"> Home </ion-breadcrumb>
<ion-breadcrumb href="#electronics"> Electronics </ion-breadcrumb>
<ion-breadcrumb href="#photography"> Photography </ion-breadcrumb>
<ion-breadcrumb href="#cameras"> Cameras </ion-breadcrumb>
<ion-breadcrumb href="#film"> Film </ion-breadcrumb>
<ion-breadcrumb> 35 mm </ion-breadcrumb>
</ion-breadcrumbs>
</ion-content>
</ion-page>
</template>

<script lang="ts">
import {
IonPage,
IonHeader,
IonToolbar,
IonTitle,
IonContent,
IonBreadcrumbs,
} from "@ionic/vue";
import { defineComponent } from "vue";

export default defineComponent({
components: {
IonPage,
IonHeader,
IonToolbar,
IonTitle,
IonContent,
IonBreadcrumbs,
},
});
</script>
3 changes: 3 additions & 0 deletions packages/vue/test/base/src/views/Components.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<ion-page>
<ion-content>
<ion-list>
<ion-item button router-link="/components/breadcrumbs">
<ion-label>Breadcrumbs</ion-label>
</ion-item>
<ion-item button router-link="/components/select">
<ion-label>Select</ion-label>
</ion-item>
Expand Down
9 changes: 9 additions & 0 deletions packages/vue/test/base/tests/e2e/specs/breadcrumbs.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
describe("Components: Breadcrumbs", () => {
beforeEach(() => {
cy.visit("http://localhost:8080/components/breadcrumbs");
});

it("should have color attribute", () => {
cy.get('ion-breadcrumbs#color').should('have.prop', 'color');
Comment on lines +1 to +7
Copy link
Contributor

@liamdebeasi liamdebeasi Mar 30, 2023

Choose a reason for hiding this comment

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

Don't need to address this now since this is re-landing another approved PR, but it looks like other frameworks would benefit from this check. Should this be a check in core instead of just in the Vue test app?

Copy link
Contributor

Choose a reason for hiding this comment

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

I can move it over to core after.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created FW-3889 to track and assigned to you @thetaPC 🚀

});
});