Problem:
Currently, when a tour tip is assigned to an element that is hidden on the page the tip position is attached to the page.
For example, if an element that sits in a vertical tab (e.g. url path settings) is referenced then because the element is visually hidden the CSS doesn't understand where to put the tool tip. It appears to add the tip to the next available parent element and as such will be placed onto the page far from the element it's referencing.
The same thing also applies to fieldsets but would probably affect any hidden element on the page.
Workaround
Our current solution is to target a tooltip on the fieldset or vertical tab label instructing the user to "Click" to continue. This assumes that the user then clicks the tab before clicking "Next" to see the next tooltip.
Possible Solutions
I can see two possible solutions to this:
1) Implement a solution that understands the visibility of a tooltip and attempts to show the field before showing the tooltip. From the current element being targeted it should be possible to select the tab that the element belongs to and trigger the event that shows the element (probably with a click() event). The difficulty here is that different fieldsets have different ways of showing elements and will have different markup so a generic solution would be difficult to implement.
2) When a tooltip is about to be displayed on the page trigger an event. This then allows module developers to integrate their modules with tour without creating lots of core code. The tour module would trigger the event, which would allow the correct fieldset to be shown, before then showing the tooltip.
I'm willing to help out with this, but I can't quite see how to get started. Any suggestions would be welcome.
Thanks,
Phil
| Comment | File | Size | Author |
|---|
Issue fork tour-2911208
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
baikho commentedThe Backbone Model & View seem to only being used to handle initiation & completion of a Tour and not further down the flow of the tooltips. The Joyrider library provides the preStepCallback which could be used to check on the visibility of the next Selector.
See attached patch for fieldset & vertical tabs support. (Modal selector excluded)
Not sure if this is the right approach, but it looks like it does the job. Tested on 8.4.x-dev
Regards
Comment #5
philipnorton42 commentedRerolled this patch for 8.7.x.
Also saw a couple of styling issues (mainly around if>else statements) so I corrected them as well.
Comment #6
baikho commentedComment #12
jackfoust commentedLooks like this patch broke in the 9.2.0 release today, both Tour JS files have had extensive changes made in this release.
Comment #15
sanduhrsDrupal core switched from joyride to shepherd: https://www.drupal.org/node/3195234
Comment #16
tobiasbComment #17
tobiasbComment #18
tobiasbComment #19
smustgrave commentedPatch in #18 appears to work but I think with this new feature there will need to be test cases added.
Comment #20
smustgrave commentedTook a shot at the test
Comment #22
smustgrave commentedMoving into review that failure was caused by something else
Comment #23
smustgrave commentedThis seemed like a bug more then a feature request.
Comment #25
smustgrave commentedNeeds work for 10.1.x
Comment #26
_utsavsharma commentedPatch for 10.1.x.
Please review.
Comment #28
smustgrave commentedComment #29
larowlanthis is too coupled to details elements, it assumes the only reason an object isn't visible is if its in a fieldset/tabset
this feels like a won't fix to me
Comment #30
smustgrave commentedMeans tour can’t really work with elements that are hidden in tabs.
Comment #31
larowlanIdeally the TipPlugin would support a ::beforeShow method that would allow a plugin class for 'hidden in a details'
Comment #32
smustgrave commentedConfused by the last comment. The tour tip applies correctly it’s just the element it’s attached to is hidden. So wouldn’t this have to happen in the JavaScript side?
Comment #33
larowlanYeah sorry I'm talking about extending the tip plugin interface to add some JS integration points
Comment #34
smustgrave commentedNot entirely sure how to do that.
Would request if this ticket is won’t fix to postpone it for when moves to contrib.
Comment #35
larowlanI think we'd need to expand the TIpPluginInterface (or add an additional one) to allow tip plugins to nominate libraries.
And then somehow wire up JS for each tip to allow it to do the 'before show' so we didn't have to hard code knowledge of e.g. details/vertical tabs in the generic JS.
But yes, might be a thing to wait for when its in contrib
Comment #36
smustgrave commentedJust not sure how the tip interface would know if the tip is inside a details tag before the page loads to determine if a new library is needed.
Comment #37
larowlanWhen the author is writing the yml, they will know, so they would nominate a different tip plugin ID for that tip
Comment #38
smustgrave commentedSo we would need a new field Boolean if this tip is in a container. Then if true load this other library?
Comment #39
smustgrave commentedHad a conversation with @larowlan on slack and most likely will have to wait until contrib, making the strong assumption that will happen.
Comment #41
quietone commentedThis extension is being deprecated, see #3336033: [Meta] Tasks to deprecate Tour module. It will be removed from core and moved to a contrib project, #3376099: [11.x] [Meta] Tasks to remove Tour.
This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
Comment #42
tobiasbComment #44
tobiasbComment #45
tobiasbComment #46
smustgrave commentedFirst fix into 2.0.x branch!