question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there any way to get current screen element?

See original GitHub issue

Hello, Is there any way to get current screen element?

By index is not possible, because I update the array of elements dynamically and the index is getting broken when swipe between elements?

Thank you.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

10reactions
sunweiyangcommented, Oct 2, 2019

@ochikov My current workaround is to use onIndexChanged and save it to a state value, which I can then use:

<Swiper
  ...
  onIndexChanged={index => this.setState({ swiperIndex: index })}
  ...>
  ...
</Swiper>
2reactions
sunweiyangcommented, Oct 2, 2019

Having the ability to grab the current index would be amazing; I too can’t find a way to do this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get the current position of an element relative to the ...
To calculate where the element is positioned relative to the top edge of the viewport, you can use a combination of:.
Read more >
Check If an Element is Visible in the Viewport in JavaScript
In this tutorial, you'll learn how to check if an element is visible in the viewport using JavaScript.
Read more >
How To Get The Current Screen Size/Browser Window
Current Screen Size ... Use window.innerWidth and window.innerHeight to get the current screen size of a page. This example displays the browser window's...
Read more >
How to test if an element is in the viewport with vanilla ...
We can pass in our element, and isInViewport() will get the bounding coordinates and run our check. It returns true if it's in...
Read more >
Element.getBoundingClientRect() - Web APIs | MDN
scrollY and window.scrollX ) to get a bounding rectangle which is independent from the current scrolling position. Examples. Basic.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found