Should Coachmark render on ComponentMount?
Apologies if I have categorized this incorrectly as I am not sure if I have misunderstood the purpose of Coachmark or I am using it incorrectly.
Requirement: Load the coachmark once the component has mount (without any user interaction).
In the sample below I load a button and want the coachmark to show once rendered. I cannot seem to get it to render at all.
Tks, Gary
The reason why Coachmark does not render on component mount is because it still doesn't have access to its target since the DOM is not loaded yet. Therefore, target is null at the time PositioningContainer is rendered, opacity is 0 and the position is not set. A workaround for this (not the best solution but a simple one for demonstration) is to set a timeout in componentDidMount and do a forceUpdate to have the Coachmark appear once the DOM is loaded.
The example you provided modified to do this can be found in the following codepen.
Please let me know if this doesn't work so I can provide further assistance as necessary.
Super thanks @khmakoto. In an ideal situation should the Coachmark be used in conjunction with a user action trigger? I envisioned the Coachmark drawing attention to something once the user has loaded the page/screen.
You're welcome!
And ideally yes, the Coachmark should be used in conjunction with a user interaction to draw attention to the target, which is the way in which the component was designed. It can be, however, tweaked to perform on page/screen load as said before. In the end it all depends on how you want to use it and if it makes sense to use the component that way :)
This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your contributions to Fabric React!
Ok, thanks for the information
@khmakoto Thanks for information. Below is my case When the user clicks on a button CoachMark is popping up and on mouse over to this CoachMark, TeachingBubbleContent is displaying. Is there a way the TeachingBubbleContent can be displayed automatically after some seconds instead of mouse over? Thanks!