2

Today I've stumbled across a rather strange behaviour in google chrome (version 62.0.3202.94). It occurs when an element inside a column-layout is styled using filter. To be more specific: only when the element is not inside the first column. Here we go:

.column-container {
  column-count: 2;
}

input[type="button"]:hover {
  filter: brightness(75%);
}
<div class="column-container">
  <div class="col">
    <input type="button" value="Button1" />
  </div>
  <div class="col">
    <input type="button" value="Button2" />
  </div>
</div>
      

As you can see, when hovering Button1 on the left side, it gets darker just as expected. But when hovering Button2 on the rigth side, it vanishes (becomes invisible). When working with column-width and resizing the window, so that the left column breaks under the right column, the hover effect on Button2 works as expected as well. All that also happens with other filter settings, eg. blur.

Two workarounds I found are:

  • Using background: hsla(0,0%,0%,0.25);
    • this is not supported in all browsers
    • when used on a different background color, it just shines through because of the transparency
  • Hack it via transform: translateZ(0); which triggers hardware acceleration
    • can be overwritten by later stylings

My questions are:

  1. Why does that happen?
  2. How do I make filter work normally for other columns than the first?

Thank you very much in advance!

Akerus
  • 363
  • 2
  • 16
  • 1
    can you specify the browser version. It works fine in Version 57.0.2987.133 – nmkyuppie Nov 30 '17 at 15:13
  • I see the problem, but only when _clicking_ the button. Hovering is OK, but it goes invisible when I click. – Mr Lister Nov 30 '17 at 17:51
  • I've noticed this same issue in Version 62.0.3202.94 (Official Build) (64-bit). First column is fine, any other column doesn't work. Thanks for the workarounds! – Bob Nocraz Dec 01 '17 at 11:00
  • @YuPPie I've got version 62.0.3202.94 running. – Akerus Dec 01 '17 at 14:45
  • @MrLister which version are you running? – Akerus Dec 01 '17 at 14:47
  • @Akerus It happens that same way in different versions, including Chromium 57.0.2987.98 on Linux and the Canary 64.0.3281.0 on Windows. The left button is fine; it gets highlighted on hover; so does the right button, until I click on it, then it disappears. – Mr Lister Dec 01 '17 at 17:19

0 Answers0