Refactor keyboard navigation to focus on current thumbnail for better accessibility
This commit is contained in:
		@@ -493,7 +493,7 @@
 | 
				
			|||||||
                            let nextIndex = (currentIndex - 1 + activeFocusableSet.length) % activeFocusableSet.length;
 | 
					                            let nextIndex = (currentIndex - 1 + activeFocusableSet.length) % activeFocusableSet.length;
 | 
				
			||||||
                            activeFocusableSet[nextIndex].focus();
 | 
					                            activeFocusableSet[nextIndex].focus();
 | 
				
			||||||
                        } else if (activeFocusableSet.length > 0) { // If nothing specific focused, focus last
 | 
					                        } else if (activeFocusableSet.length > 0) { // If nothing specific focused, focus last
 | 
				
			||||||
                            activeFocusableSet[activeFocusableSet.length - 1].focus();
 | 
					                            $("#current-thumb").focus();
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        keyHandled = true;
 | 
					                        keyHandled = true;
 | 
				
			||||||
                        break;
 | 
					                        break;
 | 
				
			||||||
@@ -504,7 +504,7 @@
 | 
				
			|||||||
                            let nextIndex = (currentIndex + 1) % activeFocusableSet.length;
 | 
					                            let nextIndex = (currentIndex + 1) % activeFocusableSet.length;
 | 
				
			||||||
                            activeFocusableSet[nextIndex].focus();
 | 
					                            activeFocusableSet[nextIndex].focus();
 | 
				
			||||||
                        } else if (activeFocusableSet.length > 0) { // If nothing specific focused, focus first
 | 
					                        } else if (activeFocusableSet.length > 0) { // If nothing specific focused, focus first
 | 
				
			||||||
                            activeFocusableSet[0].focus();
 | 
					                            $("#current-thumb").focus();
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        keyHandled = true;
 | 
					                        keyHandled = true;
 | 
				
			||||||
                        break;
 | 
					                        break;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user