I am trying to utilise the GuidedTours component within my custom component so that I can provide my users with some direct online help. So I'm having some problems with the target field so that the help modal box jumps to another tab on the record. ie main default tab has title and description, then next tab is introduction (fieldset = introtxt, field = intro_text) with editor field for lots of text. The modal appears no problems at all, but focus is still on the main default tab so I'm not able to enter any details. Any clues as to how to set focus on next tab would be greatly appreciated.
1 Answer
Found it. I needed to enter a step to click on the tab heading to direct the focus over to the new tab. So in my situation the target for this intermediary step was
target=button[aria-controls=introtxt]
So just for completeness, my array of steps looks like this
$recs[] = array(
'title'=>'Add a Title',
'desc'=>'<p>Enter a required title for the new entry.</p>',
'position'=>'bottom',
'target'=>'#jform_title',
'type'=>2,
'intertype'=>2,
'url'=>''
);
$recs[] = array(
'title'=>'Move to Introductory Tab',
'desc'=>'<p>Click on the tab Introduction</p>',
'position'=>'bottom',
'target'=>'button[aria-controls=introtxt]',
'type'=>2,
'intertype'=>4,
'url'=>''
);
$recs[] = array(
'title'=>'Introductory Text',
'desc'=>'<p>Enter an outline introduction of the record.</p>',
'position'=>'bottom',
'target'=>'#jform_intro_text',
'type'=>2,
'intertype'=>2,
'url'=>''
);
Hope this helps others.
-
-
Thank Irata, just working on other field types now so I'll be posting another question if I can't work it out. Cheers. Commented Dec 19, 2023 at 0:54