isotope icon indicating copy to clipboard operation
isotope copied to clipboard

Hidden elements are still clickable in IE

Open sereby opened this issue 15 years ago • 15 comments

In IE9 (and IE7, 8 using the developer tools to switch browser modes) elements which are hidden using the filtering option are still clickable (if they contain anchors, or other clickable elements). My solution was to include:

.isotope-hidden { display: none; }

in an IE conditional stylesheet. While this solved the issue, I'm not sure that it's the best solution. Can you confirm that this is the best method?

sereby avatar Jul 18 '11 15:07 sereby

This is a valid issue. You should have these styles

/**** Isotope Filtering ****/

.isotope-item {
  z-index: 2;
}

.isotope-hidden.isotope-item {
  pointer-events: none;
  z-index: 1;
}

The problem with display: none is that it might interfere with reveal animations. I haven't had a chance to test it.

desandro avatar Jul 18 '11 20:07 desandro

Thanks, desandro. As indicated in the documentation, I did include the recommended styles from the start, but even with them the problem persists in IE.

sereby avatar Jul 18 '11 23:07 sereby

This is an issue for me as well in IE. Doing display none will prevent the fade animation. Would love to see a fix or workaround for this.

ghost avatar Jul 26 '11 22:07 ghost

I'll have to do a test on IE. I'll let you know the results when that happens. Sorry for the procrastination on this one, debugging in IE is legit work and I haven't felt up to it for a couple weeks.

desandro avatar Aug 06 '11 20:08 desandro

I'm unable to find a good workaround. IE does not support pointer-events, which disables click events on .isotope-hidden elements.

Here's the test for IE: http://support.metafizzy.co/2011/08-11-ie-hidden.html

I've set hiddenStyle: { opacity: 0.25 } so that the big blue blocks will still be partially visible. If you shuffle the group, then toggle blue blocks off, you'll see that the grey blocks are still clickable, and the hidden blue blocks are ordered behind the visible gray blocks with z-index. However, you can still click the faded-out blue blocks in IE, in between the others.

One option is to target IE with $.browser.msie and then use a custom hiddenStyle option:

hiddenStyle: $.browser.msie ? 
  { opacity: 0.5, left: -2000 } : // IE
  { opacity: 0, scale: 0.001 }

See http://support.metafizzy.co/2011/08-11-ie-hidden-offset.html The problem here is that revealing items will be animated back in from the far left, where they were previously offset.

desandro avatar Aug 11 '11 14:08 desandro

Thanks for continuing to look into this! It seems that IE has struck yet again and presented a problem for which there is either no acceptable workaround, or one that makes you tear your hair out and curse the day that the Web was conceived.

I think that given the choice between the phantom clickables and the animate-back-in-from-far-left, I'm need to settle on the former.

sereby avatar Aug 11 '11 19:08 sereby

Hi all - this is also an issue in Opera

I got round it using an IE only stylesheet and .isotope-hidden { display: none; }

it spoils the animation a little but not too badly

for Opera I had to use this horrendous hack:

@media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) { .isotope-hidden { display: none; } }

amazing plugin otherwise

safeasdean avatar Aug 23 '11 12:08 safeasdean

  1. I've added a delegate to the container to dismiss all click events if they match the hiddenClass. See SHA: c84c22c453f0
  2. If you do have a click handler with jQuery, just add some simple logic to dismiss click events if they are .isotope-hidden. See help : preventing clicks on filtered items

With both of these solutions in place, I don't think there will be any need for .isotope-hidden { display: none; } or any other hack I might have mentioned. Please follow up if you continue to have issues.

desandro avatar Aug 23 '11 15:08 desandro

thanks

am I right in thinking this won't help them still showing a pointer and title on hover?

safeasdean avatar Aug 23 '11 15:08 safeasdean

That is correct. If those two things still need to go, you'll have to resort to the display: none style. For the pointer, you could try

.isotope-hidden:hover { pointer: default; }

desandro avatar Aug 23 '11 15:08 desandro

many thanks - I think I'll live with the slightly degraded animation for Opera and IE users - it still looks great and anyone using those browsers doesn't deserve any better :)

btw I'm using Wordpress custom taxonomies to power the filters and it works great - I'll link you up after launch

safeasdean avatar Aug 23 '11 15:08 safeasdean

The same problem occurs for me in Chrome. Changing filters a few times creates random spaces within the mozaic that are clickable. The problem disappears with .isotope-hidden { display: none; }, but the animation is 1/2 as cool :) Any suggestions? p.s. I'm using jQuery v1.6.2 and Isotope v1.4.110825.

designosis avatar Aug 26 '11 09:08 designosis

what version of chrome? on mac and pc it's fine for me on latest versions

safeasdean avatar Aug 26 '11 10:08 safeasdean

Chrome 13.0.782.112

What are best practices for CSS? I had ...

.isotope-item {
    z-index: 2;
    }
.isotope-hidden.isotope-item {
    pointer-events: none;
    z-index: 1;
    }

... also I just read in the docs that "If you are using filtering, it’s also a good idea to disable the scale transform with the hiddenStyle option and visibleStyle option." ... suppose I'll give that a try.

designosis avatar Aug 26 '11 11:08 designosis

@neokio I'm not having trouble clicked filtered-out items in Chrome 13 on http://isotope.metafizzy.co/tests/unclickable-filtered.html . Try to poke around in that demo and see what your example might be missing. Scale transforms should be used with filtered, as they area great way to prevent clicks on filtered-out items. Let me know if the docs were misleading in that regard.

desandro avatar Aug 26 '11 12:08 desandro