Skip to content

Commit

Permalink
chore: Add documentation for MultiElementWrapper's get method
Browse files Browse the repository at this point in the history
We got many customer questions why this method uses one-based
indices. Documenting this and explaining the reason makes
that explicit.
  • Loading branch information
Johannes Weber authored and johannes-weber committed Dec 15, 2022
1 parent 9af6be2 commit c0e8ad7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export class MultiElementWrapper<T extends AbstractWrapper> extends ElementWrapp
super(root);
}

/**
* Index is one-based because the method uses the :nth-child() CSS pseudo-class.
*/
get(index: number): T {
return this.elementFactory(`${this.root}:nth-child(${index})`);
}
Expand Down

0 comments on commit c0e8ad7

Please sign in to comment.