Description
When styling the next/done buttons in Driver.js (either via CSS or onPopoverRender hook), the button text gets duplicated and rendered twice with a slight offset/shift. This creates a visual glitch where you can see overlapping text that's slightly misaligned.
Steps to Reproduce
- Create a Driver.js tour configuration
- Apply custom styling to the next button via CSS class or
onPopoverRender hook (e.g., add background color, text color, padding, border-radius)
- Launch the tour
- Observe the next button (and done button)
Expected Behavior
Button should display text once, cleanly centered with the applied custom styles
Actual Behavior
- Button text appears twice, overlapping with a slight offset/shift
- Both text instances are styled with the custom styles applied
- The shift creates a visible "doubled" or "ghost text" effect
- Makes it obvious there are two instances of the same text rendered
Example Code That Triggers The Bug
// Via CSS
.driver-popover-custom .driver-popover-next-btn {
background: linear-gradient(135deg, #f15722 0%, #e0481d 100%);
color: white;
border-radius: 8px;
padding: 8px 16px;
font-weight: 700;
}
// Or via onPopoverRender hook
onPopoverRender: (popover, { config, state }) => {
if (popover.nextButton) {
popover.nextButton.style.background = 'linear-gradient(135deg, #f15722 0%, #e0481d 100%)';
popover.nextButton.style.color = 'white';
popover.nextButton.style.borderRadius = '8px';
popover.nextButton.style.padding = '8px 16px';
}
}
Root Cause
It appears that Driver.js:
- Renders the button text initially (from
nextBtnText config)
- Applies styling (either CSS or inline styles)
- The original text rendering is NOT cleared when styles are applied
- A second text instance gets rendered/styled on top of the first
- The slight offset between them makes both visible
Visual Impact
- Text appears shadowed or doubled
- Creates a blurry/ghosted effect
- Makes the button look broken or unprofessional
- Only visible when custom styling is applied
- More noticeable with contrasting colors/gradients
Affects
- Next button (
driver-popover-next-btn)
- Done button (
driver-popover-donebtn)
- Possibly other buttons when styled
Workaround
Currently no workaround available. The duplication occurs regardless of styling method used.
Expected Fix
Driver.js should ensure that when custom styling is applied to buttons, the text is rendered only once without duplication.
Description
When styling the next/done buttons in Driver.js (either via CSS or
onPopoverRenderhook), the button text gets duplicated and rendered twice with a slight offset/shift. This creates a visual glitch where you can see overlapping text that's slightly misaligned.Steps to Reproduce
onPopoverRenderhook (e.g., add background color, text color, padding, border-radius)Expected Behavior
Button should display text once, cleanly centered with the applied custom styles
Actual Behavior
Example Code That Triggers The Bug
Root Cause
It appears that Driver.js:
nextBtnTextconfig)Visual Impact
Affects
driver-popover-next-btn)driver-popover-donebtn)Workaround
Currently no workaround available. The duplication occurs regardless of styling method used.
Expected Fix
Driver.js should ensure that when custom styling is applied to buttons, the text is rendered only once without duplication.