mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
feat: add missing topOffset and leftOffset props to scroll-into-view Alignment (#35428)
This commit is contained in:
parent
c8865c4fa2
commit
81fc741f8d
5
types/scroll-into-view/index.d.ts
vendored
5
types/scroll-into-view/index.d.ts
vendored
@ -1,6 +1,7 @@
|
||||
// Type definitions for scroll-into-view 1.6.0
|
||||
// Project: https://github.com/KoryNunn/scroll-into-view
|
||||
// Definitions by: zivni <https://github.com/zivni>
|
||||
// Thibaut <https://github.com/Thibaut-Fatus>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module __ScrollIntoView {
|
||||
@ -17,6 +18,10 @@ declare module __ScrollIntoView {
|
||||
top?: number
|
||||
/** 0 to 1, default 0.5 (center) */
|
||||
left?: number
|
||||
/** pixels to offset top alignment */
|
||||
topOffset?: number
|
||||
/** pixels to offset left alignment */
|
||||
leftOffset?: number
|
||||
}
|
||||
|
||||
/** type will be 'complete' if the scroll completed or 'canceled' if the current scroll was canceled by a new scroll */
|
||||
|
||||
@ -13,11 +13,13 @@ scrollIntoView(someElement, {
|
||||
},
|
||||
align: {
|
||||
top: 0,
|
||||
left: 1
|
||||
left: 1,
|
||||
topOffset: 20,
|
||||
leftOffset: 20
|
||||
}
|
||||
});
|
||||
|
||||
scrollIntoView(someElement, function (type) {
|
||||
// Scrolling done.
|
||||
// type will be 'complete' if the scroll completed or 'canceled' if the current scroll was canceled by a new scroll
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user