Polymer / shop

The Shop app
https://shop.polymer-project.org/
986 stars 494 forks source link

withBackdrop attribute not working on the shop-buy-modal #164

Closed dafky2000 closed 6 years ago

dafky2000 commented 6 years ago

The code in src/shop-buy-modal.html defines that it should be showing

withBackdrop: {
  type: Boolean,
  value: true
},

but it is overridden in the _renderOpen...

_renderOpened() {
  ...
  this.backdropElement.style.display = 'none';
  ...

Was going to do a pull request to remove the line in _renderOpen and simply rely on withBackdrop but now I'm confused whether the intention is to have a backdrop or not.

keanulee commented 6 years ago

The purpose to setting withBackdrop to true is to use IronOverlayBehaviorImpl's focus trapping behavior (https://github.com/PolymerElements/iron-overlay-behavior/blob/master/iron-overlay-behavior.html#L51). For visual purposes though, we don't want the overlay to show so that's why we set display: none. This is kind of a hacky solution, but it works!