Skip to content

Commit d6efbb3

Browse files
committed
Fix Steps element parameter type to accept Element
1 parent c34a2b7 commit d6efbb3

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
* The `onBeforeChange` callback now receives the `nextElement` as second parameter.
44
* Add missing `updateStepElement()` to the TypeScript type declarations.
5+
* Fix Steps's `element` parameter type to also accept an `HTMLElement`.
56

67
## 0.5.0
78

index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ declare module 'intro.js-react' {
44

55
interface Step {
66
/**
7-
* CSS selector to use for the step.
7+
* CSS selector or element to use for the step.
88
*/
9-
element?: string;
9+
element?: string | HTMLElement | Element;
1010
/**
1111
* The tooltip content.
1212
*/

src/components/Steps/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default class Steps extends Component {
1919
initialStep: PropTypes.number.isRequired,
2020
steps: PropTypes.arrayOf(
2121
PropTypes.shape({
22-
element: PropTypes.string,
22+
element: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Element)]),
2323
intro: PropTypes.node.isRequired,
2424
position: introJsPropTypes.tooltipPosition,
2525
tooltipClass: PropTypes.string,

0 commit comments

Comments
 (0)