Skip to content

Commit

Permalink
Merge d328643 into f36cd6c
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriy-fix committed Oct 8, 2018
2 parents f36cd6c + d328643 commit b2c792e
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
13 changes: 13 additions & 0 deletions src/vaadin-combo-box-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,20 @@

this._observer = new Polymer.FlattenedNodesObserver(this, info => {
this._setTemplateFromNodes(info.addedNodes);
this._updatePositionTarget();
});

this._updatePositionTarget();
}

_updatePositionTarget() {
this.$.overlay.positionTarget = this._getPositionTarget();
}

_getPositionTarget() {
// Use `[part="input-field"]` if found (for `<vaadin-text-field>` and such)
return this.inputElement && this.inputElement.shadowRoot && this.inputElement.shadowRoot.querySelector('[part="input-field"]') ||
this.inputElement;
}


Expand Down
5 changes: 0 additions & 5 deletions src/vaadin-combo-box.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
<vaadin-combo-box-dropdown-wrapper id="overlay"
opened=[[opened]]
renderer=[[renderer]]
position-target="[[_getPositionTarget()]]"
_focused-index="[[_focusedIndex]]"
_item-id-path="[[itemIdPath]]"
_item-label-path="[[itemLabelPath]]"
Expand Down Expand Up @@ -393,10 +392,6 @@
this._restoreInputBlur();
}

_getPositionTarget() {
return this.$.input;
}

_updateAriaExpanded() {
if (this._nativeInput) {
this._nativeInput.setAttribute('aria-expanded', this.opened);
Expand Down
2 changes: 1 addition & 1 deletion test/overlay-position.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
}

function inputContentRect() {
return comboBox.$.input.getBoundingClientRect();
return comboBox.$.input.shadowRoot.querySelector('[part~="input-field"]').getBoundingClientRect();
}

describe('overlay', () => {
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b2c792e

Please sign in to comment.