0

I asked a question about a week ago that was answered, and to what I thought was great. There is a bug with the solution that I came up with.

I have created a Plunker to show what is going on with what I'm doing. if anyone could please tell me that would be great.

I added the following code in the dropdown component to do what is being done in the post above.

@ViewChild('dropdown') dropdown:ElementRef;

ngDoCheck(): void {
    if (this.dropdown.nativeElement.classList.contains('open')) {
        this.dropdown.nativeElement.style.position = 'absolute';
        this.dropdown.nativeElement.style.offsetTop = this.dropdown.nativeElement.style.top;
        this.dropdown.nativeElement.style.offsetLeft = this.dropdown.nativeElement.style.left;
    } else {
        this.dropdown.nativeElement.style.position = 'relative';
    }
}

Thank you for your time.

3xGuy
  • 2,235
  • 2
  • 29
  • 51
  • You can't, your container has an overflow property. Either you detach the dropdown from the container (meaning you will have to edit the bootstrap library), or you remove the overflow-y property of your container. –  Feb 20 '18 at 15:22
  • sounds like removing overflow-y would be easier. how can i do that? – 3xGuy Feb 20 '18 at 15:28
  • With `overflow-y: visible` in the container where you have `overflow: auto` –  Feb 20 '18 at 15:29
  • That didn't seem to work for me. I guess I'll look at modifying bootstrap. thanks for the help. – 3xGuy Feb 20 '18 at 15:38

0 Answers0