fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Breadcrumb - Issue with styling

Open nikhilexe opened this issue 9 years ago • 7 comments

Repro steps:

  1. Browse to http://codepen.io/nikhilexe/pen/GmXoqZ?editors=0110
  2. You can see one breadcrumb item
  3. Now apply css on this .my-custom-class { display: inline-block; }

Now with this, sometime it doesn't show the item itself or if you zoom in further then it vanishes.

Ideally it should always show one item. Not sure what display css causing issue.

nikhilexe avatar May 19 '17 12:05 nikhilexe

putting inline-block onto the container messes with the way the breadcrumb measures the available space. Do you need to have breadcrumb set to inline-block for some reason? If you do, you might also need to set a width to it.

micahgodbolt avatar May 22 '17 18:05 micahgodbolt

Thanks Micah for the reply. Before breadcrumb I need to put icon and after that one textbox and all three needs to be in the same line, hence putting inline-block. I tried putting width but it didn't work for me. Maybe I am missing something here?

nikhilexe avatar May 24 '17 06:05 nikhilexe

this is going to be tricky with the current code. Breadcrumb was built to be a block level element (expanding to fill up as much space as it could), so dynamically allocating space to it with inline-block, or flex-box is going to be difficult.

We'll probably be redoing the breadcrumb eventually using overflowSet and resizeGroup, but I'm not sure when that's going to be.

The best option right now is probably to use the onRenderItem prop to pass in your icon and text box to the breadcrumb itself, so that those items are included in the width measurements.

micahgodbolt avatar May 24 '17 15:05 micahgodbolt

@micahgodbolt We hit this as well, except in our case the Breadcrumb is a flex-item. We have content before and after the breadcrumb. As a stop-gap, can we add a prop that disables the auto-collapsing behavior for available horizontal space? Here is a PR for that: #1999

T-Hugs avatar Jun 15 '17 15:06 T-Hugs

@trevorsg we've been wanting to rework the breadcrumb resizing logic to use resizeGroup, so i took this opportunity to do that. It reduces the component complexity quite a bit and allows you to override onReduceData={ (data) => undefined } so that it'll automatically display whatever you pass in (without any truncation).

Can you take a look and see if this works for you?

micahgodbolt avatar Jun 15 '17 18:06 micahgodbolt

@micahgodbolt Super, thanks! I will try it out on Monday since I'm of the rest of this week.

T-Hugs avatar Jun 15 '17 18:06 T-Hugs

Example of inline breadcrumbs using flexbox https://codepen.io/micahgodbolt/pen/ZEvwLXz?editors=0010

micahgodbolt avatar Apr 19 '22 16:04 micahgodbolt