Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramakrishnan24689 authored Jul 24, 2023
1 parent 3dd7741 commit 9306d19
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
14 changes: 14 additions & 0 deletions Breadcrumb/Breadcrumb/components/BreadcrumbComponent.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// This wrapperstyle is required, so that,
// the breadcrumb don't shrink when its inside
// flexbox, which happens in studio
export const wrapperStyle = {
bottom: 0,
left: 0,
right: 0,
top: 0,
overflowX: 'hidden',
overflowY: 'hidden',
position: 'absolute',
width: '100%',
height: '100%',
} as React.CSSProperties;
8 changes: 2 additions & 6 deletions Breadcrumb/Breadcrumb/components/CanvasBreadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Breadcrumb as CustomBreadcrumb } from '../fluentui-fork/Breadcrumb/Brea
import { IBreadcrumbProps } from './components.types';
import { getBreadcrumbItems } from './DatasetMapping';
import { useAsync } from '@fluentui/react-hooks';
import { wrapperStyle } from './BreadcrumbComponent.styles';

export const CanvasBreadcrumb = React.memo((props: IBreadcrumbProps): React.ReactElement => {
const { items, themeJSON, onSelected, setFocus, ariaLabel, tabIndex, maxDisplayedItems, overflowIndex } = props;
Expand Down Expand Up @@ -51,19 +52,14 @@ export const CanvasBreadcrumb = React.memo((props: IBreadcrumbProps): React.Reac

const breadcrumbItems: IBreadcrumbItem[] = getBreadcrumbItems(items, onClick);

// onReduceData is required to prevent breadcrumb from shrinking
// when item changes dynamically
const returnUndefined = () => undefined;

return (
<ThemeProvider applyTo="none" theme={theme} ref={rootRef}>
<ThemeProvider applyTo="none" theme={theme} ref={rootRef} style={wrapperStyle}>
<CustomBreadcrumb
items={breadcrumbItems}
focusZoneProps={focusZoneProps}
maxDisplayedItems={maxDisplayedItems}
aria-label={ariaLabel}
overflowIndex={overflowIndex}
onReduceData={returnUndefined}
/>
</ThemeProvider>
);
Expand Down
15 changes: 0 additions & 15 deletions Breadcrumb/Breadcrumb/generated/ManifestTypes.d.ts

This file was deleted.

0 comments on commit 9306d19

Please sign in to comment.