How to set multiple positions ... ?

Doesn't Work
    <ejs-tooltip #tool openDelay="270" position="RightCenter,LeftCenter">

Doesn't Work

    <ejs-tooltip #tool openDelay="270" position="RightCenter | LeftCenter">

Doesn't Work

    <ejs-tooltip #tool openDelay="270" position="'RightCenter' | 'LeftCenter'">

Yet your code does this ???

export declare type Position = 'TopLeft' | 'TopCenter' | 'TopRight' | 'BottomLeft' | 'BottomCenter' | 'BottomRight' | 'LeftTop' | 'LeftCenter' | 'LeftBottom' | 'RightTop' | 'RightCenter' | 'RightBottom';


3 Replies

SM Shalini Maragathavel Syncfusion Team September 28, 2021 12:40 PM UTC

Hi Michael, 

Greetings from Syncfusion support. 

Based on your query, we suspect that you need to dynamically change the position of the Tooltip. You can achieve your requirement by setting the required position value in the position property of Tooltip as demonstrated in the below code snippet,   
  
 
        <ejs-tooltip #tooltip content='Lets go green & Save Earth !!!' style="display:block;position:absolute;left:calc( 50% - 60px);top:45%;"> 
            <button ejs-button>Show Tooltip</button> 
        </ejs-tooltip> 
     
    <select id="positions" (change)="onChange($event.target.value)" class="form-control"> 
                                     . . . 
        </select> 
                             
------------------------------------------------------------------------- 
export class AppComponent { 
    //Handle tooltip position based on drop-down value change 
    onChange(value: string) { 
        this.control.position = value as Position; 
    } 
} 
 

In the below sample, we have dynamically modified the Tooltip position based on the dropdown value for your reference. 
Please let us know if you need any further assistance. 

Regards, 
Shalini M. 




MG Michael Griffiin September 28, 2021 01:05 PM UTC

Yep, but again, you don't set the position to multiples, I have seen the demo's and the documentation. I guess you are telling me that "position" can only be one value, not both LeftCenter and RightCenter whichever is more appropriate given the space around it. Is that correct?



SM Shalini Maragathavel Syncfusion Team September 29, 2021 12:34 PM UTC

Hi Michael, 

Good day to you. 

We checked your query and would like to let you know that the Tooltip does not support multiple combination of values for position property. In Tooltip component, we have a windowCollision property to handle Tooltip position when the Tooltip is not positioned properly based on the target.  

Please find the below documentation for more information on Tooltip component. 

Please get back to us if you need any further assistance.

Regards,
Shalini M. 


Loader.
Up arrow icon