Comments (3)
Thanks @rouilj for the feedback. Now that you mentioned it, I think the documentation does need some improvement in the way hooks mechanism is working. I will improve it this week. Thanks!
from driver.js.
Instead of registering listeners for Tab
key, why not simply listen to focus
and blur
outside the driver lifecycle and control it simply using highlight
instead of using tour so you don't have to worry about moveNext
and movePrevious
.
I would recommend you to get rid of your old logic and rethink according to the latest version. Most of what you have been doing, you can do it using simple highlight
and pre-existing hooks. For example here is a sample implementation for the form similar to what you have been building.
Also, please look at the documentation for the configuration details.
from driver.js.
Hello Kamran:
Thanks for your reply.
I chose tour to make sure that the user goes through every form element. Using tab/shift-tab was a response to users expecting to tab to the next field. Because driver can't make the underlying page inert, using tab caused the focus to shift, but tour's highlight/popup did not change.
Your rewrite includes a progress indicator. This is something that was missing before and that I want to keep. From what I can see there is no progress indicator (nor can there be) in the example you recommend.
I read and re-read the documentation of the configuration details and I still don't understand why some of them have Started forms and other's don't. E.G. There is an onHighlightStarted but no onDeselectStarted. Also I don't understand what should be done in a Started versus a non-started callback. The config file documentation:
// Hooks to run before and after highlighting
// each step. Each hook receives the following
// parameters:
// - element: The target DOM element of the step
// - step: The step object configured for the step
// - options.config: The current configuration options
// - options.state: The current state of the driver
doesn't explain what happens between onHighlightStarted and onHighlighted and why I would use one over the other. Similarly for onDestroyStarted and onDestroy.
I also don't understand the exact order of the events/callbacks/hooks. There is no explanation of when onPopoverRender is run compared to the onHighlight* callbacks. So I set up a possible call sequence for you to verify.
As I mentioned, it seems like there is a missing hook that is the opposite of onDestroyed.
I could:
- define each callback and log them to try to discover the order, or
- read all the code and try to figure out what the difference is between the onXStarted and onX callbacks.
Even if I were to expend that effort, I have no confidence that I am using them correctly without documentation. Without documentation, I could be relying on a bug in the code that will be changed by some future development.
Thanks again for writing driver.js.
from driver.js.
Related Issues (20)
- Add onOverlayClicked callback
- Can ‘getConfig("animate")’ be replaced with ‘isAnimatedTour’ ?
- Can ‘getConfig("animate")’ be replaced with ‘isAnimatedTour’ ?
- Is there a way to make the overlay mask fixed to an element area instead of the entire body? HOT 1
- (Re) Support the feature to move next on click outside the element
- Can the position of a popover be fixed?
- Can this work with Canvas elements? HOT 2
- How can I make the popup display while the project can be clicked normally?
- How can I customize a popover and button using MUI?
- Step positions are erratic HOT 1
- Missing data
- [Suggestion] Add disableActiveInteraction to Drive Step Configuration.
- Skip step for missing element
- [Feature Request] Expose step index in DOM HOT 1
- Hide "previous" button on step 1 HOT 1
- [Bug] Methods hasNextStep and hasPreviousStep do not return boolean HOT 1
- [Feature Request] Lifecycle events HOT 1
- aria-controls attribute removed during runtime. HOT 3
- Highlight element in parent window from iframe HOT 1
- Missing close button in Popover example & personal project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from driver.js.