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

Issue fork tour-2911208

Command icon 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

philipnorton42 created an issue. See original summary.

baikho’s picture

The 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

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

philipnorton42’s picture

Rerolled this patch for 8.7.x.
Also saw a couple of styling issues (mainly around if>else statements) so I corrected them as well.

baikho’s picture

Version: 8.6.x-dev » 8.7.x-dev
Status: Active » Needs review

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

jackfoust’s picture

Looks like this patch broke in the 9.2.0 release today, both Tour JS files have had extensive changes made in this release.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

sanduhrs’s picture

Status: Needs review » Needs work

Drupal core switched from joyride to shepherd: https://www.drupal.org/node/3195234

tobiasb’s picture

Status: Needs work » Needs review
StatusFileSize
new2.09 KB
tobiasb’s picture

Title: Add support for fieldsets/vertical tabs » Add support for details/vertical tabs
tobiasb’s picture

StatusFileSize
new2.14 KB
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Patch in #18 appears to work but I think with this new feature there will need to be test cases added.

smustgrave’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new2.51 KB
new2.18 KB
new4.66 KB

Took a shot at the test

Status: Needs review » Needs work

The last submitted patch, 20: 2911208-20.patch, failed testing. View results

smustgrave’s picture

Status: Needs work » Needs review

Moving into review that failure was caused by something else

smustgrave’s picture

Category: Feature request » Bug report
Issue tags: +Bug Smash Initiative

This seemed like a bug more then a feature request.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Needs work

Needs work for 10.1.x

_utsavsharma’s picture

Status: Needs work » Needs review
StatusFileSize
new3.36 KB
new3.36 KB

Patch for 10.1.x.
Please review.

Status: Needs review » Needs work

The last submitted patch, 26: 2911208-26.patch, failed testing. View results

smustgrave’s picture

Status: Needs work » Needs review
StatusFileSize
new2.93 KB
new3.63 KB
larowlan’s picture

+++ b/core/modules/tour/js/tour.js
@@ -239,7 +239,22 @@
+                  const details = $(selector).parents('details');
+                  if (details) {
+                    const id = details.attr('id');
+                    const link = $('a[href="#'.concat(id, '"]'));
+                    if (link.length) {
+                      link.click();
+                    } else {
+                      details.find('summary').click();

this 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

smustgrave’s picture

Means tour can’t really work with elements that are hidden in tabs.

larowlan’s picture

Ideally the TipPlugin would support a ::beforeShow method that would allow a plugin class for 'hidden in a details'

smustgrave’s picture

Confused 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?

larowlan’s picture

Yeah sorry I'm talking about extending the tip plugin interface to add some JS integration points

smustgrave’s picture

Not entirely sure how to do that.

Would request if this ticket is won’t fix to postpone it for when moves to contrib.

larowlan’s picture

I 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

smustgrave’s picture

Just 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.

larowlan’s picture

When the author is writing the yml, they will know, so they would nominate a different tip plugin ID for that tip

smustgrave’s picture

So we would need a new field Boolean if this tip is in a container. Then if true load this other library?

smustgrave’s picture

Status: Needs review » Needs work
StatusFileSize
new271.24 KB
new295.06 KB

Had a conversation with @larowlan on slack and most likely will have to wait until contrib, making the strong assumption that will happen.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Needs work » Postponed

This 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.

tobiasb’s picture

Project: Drupal core » Tour
Version: 11.x-dev » 1.0.x-dev
Component: tour.module » Code

tobiasb’s picture

Status: Postponed » Needs review
tobiasb’s picture

smustgrave’s picture

Version: 1.0.x-dev » 2.0.x-dev
Status: Needs review » Fixed

First fix into 2.0.x branch!

  • smustgrave committed 748737b2 on 2.0.x authored by tobiasb
    Issue #2911208 by smustgrave, _utsavsharma: Add support for details/...

  • smustgrave committed c0d870b8 on 2.0.x
    Issue #2911208 by smustgrave, _utsavsharma: Add support for details/...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.