Material: panel: relativeTo($event.srcElement) does not work

Created on 15 Jun 2017  路  5Comments  路  Source: angular/material

Actual Behavior:

CodePen (or steps to reproduce the issue): *

AngularJS Versions: *

  • AngularJS Version:1.5.5
  • AngularJS Material Version:Latest

Additional Information:

  • Browser Type: Firefox
  • Browser Version:53.0.3
  • OS: Windows 8
  • Stack Traces:

Shortcut to create a new CodePen Demo.
Note: * indicates required information. Without this information, your issue may be auto-closed.

Do not modify the titles or questions. Simply add your responses to the ends of the questions.
Add more lines if needed.

FireFox fixed bug docs

All 5 comments

Its working if I use $event.target instead of $event.srcElement

The samples use MdPanelPosition for positioning. Where did you see $event.srcElement in the samples or documentation? Maybe the documentation needs to be fixed (can you point out where you saw it)?

https://material.angularjs.org/latest/api/type/MdPanelPosition
https://material.angularjs.org/latest/api/service/$mdPanel

This is how the sample sets the relative positioning:

var position = this._mdPanel.newPanelPosition()
      .relativeTo('.demo-menu-open-button')
      .addPanelPosition(this._mdPanel.xPosition.ALIGN_START, this._mdPanel.yPosition.BELOW);

Could you please close the issue if setting the position with MdPosition works?

123
Please take a look. Open https://material.angularjs.org/latest/demo/panel in Firefox, and click the menu button
12443
I described the issue as clear as possible.

It also doesn't work if to use class name:

      let position = this.$mdPanel.newPanelPosition()
      .relativeTo('.filter-toolbar')
      .addPanelPosition(this.$mdPanel.xPosition.ALIGN_END, this.$mdPanel.yPosition.BELOW);

Fixed by PR #11234 in 1.1.9.

Was this page helpful?
0 / 5 - 0 ratings