Skip to content

Tooltip not shown in ion-item #17

Open

Description

@mediengestadler

Hi,

if you use tooltip laptop in an ion-item it will be not displayed, because the wrapper is overflow: hidden and the tip is inserted after the element.

It would be better, if the tooltip is inserted at the end of the page

Activity

  1. Baidaly commented on Jan 15, 2024

    @Baidaly

    I just copied the code into my project and adjusted the following to insert the component at the end of the page:

    export class TooltipDirective implements OnInit, AfterViewInit, OnDestroy {
        // The rest of the code
        constructor(
            private el: ElementRef,
            private appRef: ApplicationRef,
            private platform: Platform,
            private cfr: ComponentFactoryResolver,
            private tooltipCtrl: TooltipController,
            private injector: Injector,
            @Inject(DOCUMENT) private document: Document
        ) {}
    
        private _createTooltipComponent() {
            const componentFactory = this.cfr.resolveComponentFactory(TooltipBox);
            this._tooltipElement = componentFactory.create(this.injector);
    
            // Append the tooltip component to the body of the page
            this.document.body.appendChild(
                this._tooltipElement.location.nativeElement
            );
    
            this.appRef.attachView(this._tooltipElement.hostView);
            this.tooltipCtrl.addTooltip(this);
        }
    
        // The rest of the code
    }
    

    Here is the sample structure:
    F2429599-B3AC-4B7E-84D7-E94632A38A49_1_201_a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions