Skip to content

Commit 931e41a

Browse files
UmaKPillaivlad9719umapillaiks22UmaKPillai
authored
Fix scroll to element (#360)
* feat: introduce getCssPropertyValue * feat: extend getCssPropertyValue to accept selectors or elements * docs: add documentation for getCssPropertyValue * test: revert profile * feat: Implement getCssPropertyValue for ui5 namespace * docs: add example * tests: add error case for nonUi5 - getCssPropertyValue * Test: Add error case for getCssPropertyValue * chore: re-run npm install and update docs * Fix: Throw error if element not found * Chore: Redundant change revert * Fix: Return type for readJson * Fix: Throws error if element not found for scrollToElement in ui5 * Chore: Reverts redundant changes in scrollToElement function * Fix: arguments in fill function * chore: revert change to fill function --------- Co-authored-by: Uladzislau Dauhashei <v.dolgoshey@gmail.com> Co-authored-by: uma <umapillaiks22@gmail.com> Co-authored-by: UmaKPillai <umapillai@sap.com>
1 parent dd69e9d commit 931e41a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/doc.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5318,13 +5318,13 @@ Scrolls an element into view.
53185318
**Example**
53195319
```js
53205320
// Scroll to element with center alignment.
5321-
const elem = await nonUi5.userInteraction.getElementById("footer01");
5321+
const elem = await nonUi5.element.getById("footer01");
53225322
await nonUi5.userInteraction.scrollToElement(elem, "center");
53235323
```
53245324
**Example**
53255325
```js
53265326
// Scroll to element with custom alignment.
5327-
const elem = await nonUi5.userInteraction.getElementById("footer01");
5327+
const elem = await nonUi5.element.getById("footer01");
53285328
const alignment = {
53295329
block: "start",
53305330
inline: "center"

src/reuse/modules/nonUi5/userInteraction.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -406,12 +406,12 @@ export class UserInteraction {
406406
*
407407
* @example
408408
* // Scroll to element with center alignment.
409-
* const elem = await nonUi5.userInteraction.getElementById("footer01");
409+
* const elem = await nonUi5.element.getById("footer01");
410410
* await nonUi5.userInteraction.scrollToElement(elem, "center");
411411
*
412412
* @example
413413
* // Scroll to element with custom alignment.
414-
* const elem = await nonUi5.userInteraction.getElementById("footer01");
414+
* const elem = await nonUi5.element.getById("footer01");
415415
* const alignment = {
416416
* block: "start",
417417
* inline: "center"
@@ -422,7 +422,7 @@ export class UserInteraction {
422422
async scrollToElement(elementOrSelector: Element | string, alignment: AlignmentOptions | AlignmentValues = "center") {
423423
const vl = this.vlf.initLog(this.scrollToElement);
424424
let options = {};
425-
425+
426426
try {
427427
const element = await resolveCssSelectorOrElement(elementOrSelector);
428428
if (typeof alignment === "string") {

0 commit comments

Comments
 (0)