Coder Social home page Coder Social logo

paper-menu-button's Introduction

paper-menu-button's People

Contributors

addyosmani avatar chrismckenzie avatar dfreedm avatar ebidel avatar frankiefu avatar keanulee avatar sorvell avatar tjsavage avatar tyriar avatar zclark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

paper-menu-button's Issues

Keyboard accessibility broken with shadow dom enabled.

The following setup causes the arrow key navigation of paper menu to not work when inside a button. I believe the important points are:

  • Have a paper-menu-button with a paper-menu inside another custom element
  • Use the custom element somewhere
  • Have shadow DOM turned on

Turning off shadow DOM causes it to work. Moving the button to the top level causes it to work.

index.html

<html>
<head>

  <title>broken-menu-test</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
  <script>
    window.Polymer = window.Polymer || {};
    window.Polymer.dom = 'shadow';
  </script>
  <link rel="import" href="my-element.html">

</head>
<body>

  <my-element></my-element>

</body>
</html>

my-element.html

<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/paper-icon-button/paper-icon-button.html">
<link rel="import" href="bower_components/paper-menu-button/paper-menu-button.html">
<link rel="import" href="bower_components/paper-item/paper-item.html">
<link rel="import" href="bower_components/paper-menu/paper-menu.html">

<dom-module id="my-element">
  <template>
    <paper-menu-button>
      <paper-icon-button icon="menu" class="dropdown-trigger"></paper-icon-button>
      <paper-menu class="dropdown-content">
        <paper-item>Share</paper-item>
        <paper-item>Settings</paper-item>
        <paper-item>Help</paper-item>
      </paper-menu>
    </paper-menu-button>
  </template>
</dom-module>

<script>
(function() {
  Polymer({
    is: 'my-element',
  });
})();

</script>

paper-menu-button theming should be aligned with paper-dropdown-menu

paper-dropdown-menu allows you to set text and background color with:

paper-dropdown-menu::shadow #dropdown {
    color: purple;
    background-color: #eee;
} 

ALSO, paper-menu-button allows you to set the text and background color similarly:

  paper-menu-button::shadow #menu {
    color: lightpink;
    background-color: lightgreen;
  }

PROPOSE:

  1. align the shadow element id ('menu' is preferable to 'dropdown' since it's the common word in the name of both elements)

  2. remove this part of the documentation, as it is not necessary (user can currently use color property with the #menu selector as shown above) and doesn't conform to class names of other paper elements:

    paper-menu-button::shadow .paper-menu-button-overlay-bg { background: green; }

Change to paper-shadow make items non-selectable

Using paper-items as child works, but <div> do not. The paper-shadow overlays the drop down and prevents items from the <div> from being selectable.

I was able to solve this by putting a z-index: -1; on paper-shadow.

Odd behavior when to close to the right hand side of the window

or: max-width of core-menu#menu gets smaller on repeated open/close only if no scroll bar present and only if very close to the right edge of the window.

A confusing bug. I have a core-toolbar at the top of a 'body style="overflow: auto;"'. It includes some 'paper-menu-button's.

When there is no scroll bar present, it looks normal (except for bug #33). But as soon as the scroll bar is present, the (auto calculated?) max-width value of core-menu#menu becomes smaller and smaller the more often you open and close the menu. This is only the case for the very right 'paper-menu-button' right next to the scroll bar. In fact, this odd behavior depends on the distance to the right edge of the window. The very same with a larger margin-right is working fine.

Normal menu when distance to right edge of window is large enough or when scroll bar is present:
chrome legacy window 30 08 2014 052305 bmp

Menu getting narrower and narrower when too close to the edge and no scroll bar is present:
chrome legacy window 30 08 2014 052330 bmp

Error: Uncaught RangeError: Maximum call stack size exceeded (:3737)

I'm developing a Dart application that has some paper-menu-button elements. They are working fine: when you click the menu button, it shows the menu items and they can handle events.

The problem occurs in two situations:
1 - when you click outside the menu items area (after clicking the menu trigger, of course);
2 - when you click a menu item that has no handler.

This is the error:
Uncaught RangeError: Maximum call stack size exceeded (:3737)

I think that this is not enough information, but I need further instructions on how to track the error more properly.

paper-menu-button theming ripple doesn't seem to work

Per the instructions in the documentation, I'm using this CSS to try to style the ripple of a paper-menu-button, but not getting any results:

  paper-menu-button::shadow .paper-menu-button-overlay-ink {
    background: blue;
  }

Also there's a typo in the docs: only a single colon before the shadow pseudo-element, should be two.

popup overlay blocks adjacent content after initial open

Before being opened core-popup-menu has a display of none. After opening the menu and closing it, the display remains in block even though the menu is not longer visible. This blocks nearby buttons/etc that the popup had overlapped when open.

Paper-menu-button-overlay doesn't work with angular-node-bind

HTML

<paper-menu-button-overlay relatedTarget="[[ctrl.angular-variable]]" halign="center">
  Hello World
</paper-menu-button-overlay>

Calling .toggle() method on this polymer element causes an error as this.target.cachedSize is empty. Adding

if(! this.target.cachedSize)
  this.target.cachedSize = this.target.getBoundingClientRect();

before lib/src /paper-menu-button/paper-menu-button-overlay.html:L67 solves the issue

Broken in Safari

Apologies if this is part of a bigger safari/polymer issue. I noticed that clicking the button in the demo doesn't do anything in Safari and the button colors are black instead of white.

Call stack size error on rapid clicks

In the demo, click the menu button rapidly a dozen or so times. This seems to put it in a bad state and all subsequent menu selection results in an 'Uncaught RangeError: Maximum call stack size exceeded' coming out of the core-overlay focus. Tested in Chrome 36 & 38.

Shadow on the dropdown box is weird

When the animation begins, core-dropdown has no shadow because .paper-shadow-top-z-1 is changed to .paper-shadow-top-z-0 and after animation shadow appears. This looks really awkward and previous version doesn't have this problem. I noticed 2 div elements which have paper-shadow class was moved into core-dropdown( they were #overlayBg 's children elements before), and they don't have scale animation. Is this change intentional?

paper-menu-button-transition: Cannot read property 'getDistributedNodes' of null

lib/src/paper-menu-button/paper-menu-button-transition.html: L78

 var nodes = window.ShadowDOMPolyfill ? Platform.queryAllShadows(node.querySelector('core-menu'), 'content').getDistributedNodes() : node.querySelector('core-menu::shadow content').getDistributedNodes().array();

should be

 var nodes = window.ShadowDOMPolyfill ? Platform.queryAllShadows(node.querySelector('core-menu'), 'content').getDistributedNodes() : node.querySelector('core-menu content').getDistributedNodes().array();

as there is no shadow root between core-menu and content.

Shadowing around dropdown menu

This is more of a question than an issue. I'm having difficulty determining what code is allowing for shadowing around the dropdown menu itself (such as shown on the demo). Can this be done without using paper-shadow for instance?

Layout broken after core-popup-menu implementation

core-popup-menu has overflow: scroll and therefore the scrollbars are taking up the space on the right and bottom sides.

Take a look at the screenshot:

screenshot from 2014-08-29 13 41 39

We simply fixed with
paper-menu-button::shadow #menu::shadow #menu { overflow: auto; }

But I'm thinking it might be a good idea to have another attribute in core-popup-menu to show/hide scrollbars?

paper-menu-button should support a label attribute

I've got a paper-menu-button using icon="add" that allows the user to select one type of a number of similar things to add to the document (more specifically, the button allows the user to add one of a number of different social network links to a document). While it's working great, it'd really be better if the component supported the label attribute and showed a text label off to the right. Otherwise it's just a + button with no explanation of what's being added.

I can see this label being useful more generally for non-"add" functionality, and have considered using it elsewhere in my project with a label.

<core-menu> item selection should not stay selected when reopened

It's a bit odd that when I use a twice that has a that the item stays selected after I click it, and when I reopen it, that one is still selected. You can observe this behavior in https://www.polymer-project.org/components/paper-menu-button/demo.html by clicking the first button.

In a regular drop-down field it may make sense to show the currently selected value, but in a (where you're not so much choosing a selection as just choosing one of many actions), showing the previous selection is confusing and strange.

Error in web-animation-js

Use of this component causes the following error in web-animation-js when trying to click the menu button to expand it
Uncaught TypeError: Cannot read property 'offset' of undefined web-animations.js:2244createObject._sampleForProperty web-animations.js:2244createObject._sample web-animations.js:2206createObject._sample web-animations.js:1346ticker web-animations.js:5512(anonymous function)

Paper-menu-button closes when scroll-bar is clicked and released

I have a polymer paper-menu-button in my html webpage, when the user clicks the button the many selections and the overflow appear, with the overflow handled by the scroll bar.

However, for some reason when the user tries to view the overflow via mouse button 1 and the scroll bar, when they release the mouse button 1 the paper-menu-button selection closes and you cannot see any selections anymore, just the button.

Is there a way to exclude clicks on the scroll-bar from closing the selection screen of the button?

I have tried these solutions

body /deep/ core-menu {
    overflow-y:scroll;
}

body /deep/ core-menu {
    overflow: visible;
}

Solution 1 does not change any behavior and solution 2 creates overflow to be displayed on button-press instead of on scroll.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.