@swiftbrowser/web 0.9.8 → 0.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/protocol.ts +6 -0
- package/src/scrollTo.ts +3 -2
package/package.json
CHANGED
package/src/protocol.ts
CHANGED
|
@@ -2314,6 +2314,12 @@ export interface ScrollToCommand {
|
|
|
2314
2314
|
anchor: UnitPoint | null;
|
|
2315
2315
|
/** Increases with every request (across readers); the page carries out each serial once. */
|
|
2316
2316
|
serial: number;
|
|
2317
|
+
/**
|
|
2318
|
+
* The axes to scroll on; both when omitted. `.scrollPosition(id:)` names
|
|
2319
|
+
* its scroll view's axes, so setting it scrolls that view alone and not a
|
|
2320
|
+
* list the view sits in.
|
|
2321
|
+
*/
|
|
2322
|
+
axes?: ScrollAxes;
|
|
2317
2323
|
}
|
|
2318
2324
|
|
|
2319
2325
|
export interface Style {
|
package/src/scrollTo.ts
CHANGED
|
@@ -82,8 +82,9 @@ export function scrollToTarget(
|
|
|
82
82
|
const target = result.chrome.get(id)?.['row'] ?? result.frames.get(id);
|
|
83
83
|
if (!target) return 0;
|
|
84
84
|
const anchor = anchorOf(command);
|
|
85
|
-
|
|
86
|
-
let
|
|
85
|
+
// Axes the command leaves out are done before they start.
|
|
86
|
+
let horizontalDone = command?.axes === 'vertical';
|
|
87
|
+
let verticalDone = command?.axes === 'horizontal';
|
|
87
88
|
let scrolled = 0;
|
|
88
89
|
for (let at = ctx.parents.get(id); at !== undefined && at !== 0; at = ctx.parents.get(at)) {
|
|
89
90
|
const node = ctx.nodes.get(at);
|