OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Nearest letter from an alphabet array for navigation in reactjs

  • Thread starter Thread starter Anurag Ranjan
  • Start date Start date
A

Anurag Ranjan

Guest
I have one country list array object sorted based on key value where keys are alphabets. I have one section of all alphabets list for navigation. Once user clicks on any alphabets letter content should scroll to that letter. Or if that key is not having value it should scroll to nearest key having value.

Ex: There are some keys like H,I,J,K,Q which doesn't have value in country array. So once I click on "I" keys it should scroll to nearest keys having value ie: G How I can check and pick nearest key from an alphabet array which is having value once user selects any keys.

<p>I have one country list array object sorted based on key value where keys are alphabets. I have one section of all alphabets list for navigation. Once user clicks on any alphabets letter content should scroll to that letter. Or if that key is not having value it should scroll to nearest key having value.</p>
<p>Ex: There are some keys like H,I,J,K,Q which doesn't have value in country array.
So once I click on "I" keys it should scroll to nearest keys having value ie: G
How I can check and pick nearest key from an alphabet array which is having value once user selects any keys.</p>
 

Latest posts

M
Replies
0
Views
1
Muhammad Rafli Aditya. H
M
Top