material icon indicating copy to clipboard operation
material copied to clipboard

md-fab-speed-dial: md-fab-actions intercepts pointer events when hidden

Open PezzerDev opened this issue 11 years ago • 7 comments

The height of the md-fab-actions container within an md-fab-speed-dial is non-zero even when hidden. As a result, it is intercepting pointer events. I'm not sure what the best approach is, but the following CSS fixed things for me:

md-fab-speed-dial md-fab-actions[aria-hidden] {
    height: 0;
}

PezzerDev avatar Oct 27 '15 16:10 PezzerDev

What version are you using? This was fixed recently by using the CSS pointer-events: none in the component's CSS.

topherfangio avatar Oct 27 '15 16:10 topherfangio

This is still an an issue as of 0.11.4.

PezzerDev avatar Oct 27 '15 20:10 PezzerDev

Can you provide a Codepen?

Your height CSS solution only works when using the "up" direction I'm afraid, that's why I opted for the pointer events.

topherfangio avatar Oct 27 '15 21:10 topherfangio

I figured out the problem. I had the md-fab-speed-dial wrapped in a div which was inheriting the dimensions of the md-fab-speed-dial and blocking mouse events. Everything works as intended if I remove the wrapping tag, or apply pointer-events: none to it.

Thanks for the help!

PezzerDev avatar Oct 27 '15 21:10 PezzerDev

Glad you got it working, and sorry for the confusion! I'll add some info to the docs about how that works :smile:

topherfangio avatar Oct 28 '15 01:10 topherfangio

Are there any restrictions on where to use md-fab-speed-dial? I'm trying to add it inside md-card-header and I am experiencing the same issue: the md-fab-actions, although hidden, has a large height assigned to it, which screws up my header layout. I'm using 1.0.6.

amergin avatar Mar 20 '16 16:03 amergin

@amergin There aren't any specific restrictions, but because the component uses Flexbox internally, putting it inside a smaller item would definitely cause some issues (like you've noticed).

If you can make the elements siblings and use absolute or relative positioning for the FAB, that tends to make it easier.

topherfangio avatar Mar 21 '16 19:03 topherfangio