forked from MapComplete/MapComplete
Merge develop
This commit is contained in:
commit
5a9f8f0a0a
62 changed files with 4448 additions and 710 deletions
|
@ -1275,7 +1275,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
|
||||
public static sortedByLevenshteinDistance<T>(
|
||||
reference: string,
|
||||
ts: T[],
|
||||
ts: ReadonlyArray<T>,
|
||||
getName: (t: T) => string
|
||||
): T[] {
|
||||
const withDistance: [T, number][] = ts.map((t) => [
|
||||
|
@ -1464,6 +1464,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
if (!element) {
|
||||
return
|
||||
}
|
||||
console.log("Scrolling into view:", element)
|
||||
// Is the element completely in the view?
|
||||
const parentRect = Utils.findParentWithScrolling(element)?.getBoundingClientRect()
|
||||
if (!parentRect) {
|
||||
|
@ -1474,7 +1475,9 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
// Check if the element is within the vertical bounds of the parent element
|
||||
const topIsVisible = elementRect.top >= parentRect.top
|
||||
const bottomIsVisible = elementRect.bottom <= parentRect.bottom
|
||||
const inView = topIsVisible && bottomIsVisible
|
||||
const leftIsVisible = elementRect.left >= parentRect.left
|
||||
const rightIsVisible = elementRect.right <= parentRect.right
|
||||
const inView = topIsVisible && bottomIsVisible && leftIsVisible && rightIsVisible
|
||||
if (inView) {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue