Skip to content

Commit

Permalink
Fixed #814 - Overlays wrong position on initial/first render
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Mar 15, 2019
1 parent e1e72b3 commit fe13149
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/autocomplete/AutoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ export class AutoComplete extends Component {
let target = this.props.multiple ? this.multiContainer : this.inputEl;

if (this.props.appendTo) {
DomHandler.absolutePosition(this.panel.element, target);
this.panel.element.style.minWidth = DomHandler.getWidth(target) + 'px';
DomHandler.absolutePosition(this.panel.element, target);
}
else {
DomHandler.relativePosition(this.panel.element, target);
Expand Down
2 changes: 1 addition & 1 deletion src/components/colorpicker/ColorPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@ export class ColorPicker extends Component {

alignPanel() {
if (this.props.appendTo) {
DomHandler.absolutePosition(this.panel.element, this.container);
this.panel.element.style.minWidth = DomHandler.getWidth(this.container) + 'px';
DomHandler.absolutePosition(this.panel.element, this.container);
}
else {
DomHandler.relativePosition(this.panel.element, this.container);
Expand Down
4 changes: 2 additions & 2 deletions src/components/dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ export class Dropdown extends Component {
return (index !== -1) ? this.props.options[index] : null;
}

show() {
show() {
this.panel.element.style.zIndex = String(DomHandler.generateZIndex());
this.panel.element.style.display = 'block';

Expand Down Expand Up @@ -453,8 +453,8 @@ export class Dropdown extends Component {

alignPanel() {
if(this.props.appendTo) {
DomHandler.absolutePosition(this.panel.element, this.container);
this.panel.element.style.minWidth = DomHandler.getWidth(this.container) + 'px';
DomHandler.absolutePosition(this.panel.element, this.container);
}
else {
DomHandler.relativePosition(this.panel.element, this.container);
Expand Down
2 changes: 1 addition & 1 deletion src/components/multiselect/MultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ export class MultiSelect extends Component {

alignPanel() {
if (this.props.appendTo) {
DomHandler.absolutePosition(this.panel.element, this.container);
this.panel.element.style.minWidth = DomHandler.getWidth(this.container) + 'px';
DomHandler.absolutePosition(this.panel.element, this.container);
}
else {
DomHandler.relativePosition(this.panel.element, this.container);
Expand Down
2 changes: 1 addition & 1 deletion src/components/splitbutton/SplitButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ export class SplitButton extends Component {

alignPanel() {
if (this.props.appendTo) {
DomHandler.absolutePosition(this.panel.element, this.container);
this.panel.element.style.minWidth = DomHandler.getWidth(this.container) + 'px';
DomHandler.absolutePosition(this.panel.element, this.container);
}
else {
DomHandler.relativePosition(this.panel.element, this.container);
Expand Down

0 comments on commit fe13149

Please sign in to comment.