googlearchive / core-toolbar

Basic toolbar
7 stars 10 forks source link

Allow disabled buttons to have no pointer-events #13

Closed MetaMemoryT closed 9 years ago

MetaMemoryT commented 9 years ago

Before, disabled paper-icon-button and core-icon-button still received pointer-events. See Gist https://gist.github.com/MetaMemoryT/17c216c4a45add089f9e#file-buttons-in-core-toolbar-disabled-noclick-html for a demonstration. The Gist also includes some style rules to work around the existing implementation.

The problem is that this rule:

/* make elements (e.g. buttons) respond to mouse/touch events */
polyfill-next-selector { content: '.toolbar-tools > *'; }
::content > * {
  pointer-events: auto;
}

Overides the rule declared in core-icon-button.css which is:

:host([disabled]) {
  opacity: 0.6;
  pointer-events: none;
}

Because :host is least specific.

frankiefu commented 9 years ago

Thanks for the PR. We've fixed the issue a bit differently here: https://github.com/Polymer/core-toolbar/commit/85d9c11ea3f35061be776859db5a2451860da419