Maintain focus for inner-elements in a11y component
This commit is contained in:
		
							parent
							
								
									1d4d17eb94
								
							
						
					
					
						commit
						acebd434c1
					
				
					 2 changed files with 4 additions and 2 deletions
				
			
		|  | @ -10,7 +10,9 @@ export default class SortableGroupAccessibleComponent extends Component { | ||||||
|   handleFocus() { this.groupHasFocus = true; } |   handleFocus() { this.groupHasFocus = true; } | ||||||
| 
 | 
 | ||||||
|   @action |   @action | ||||||
|   handleBlur() { this.groupHasFocus = false; } |   handleBlur({ target, relatedTarget }) { | ||||||
|  |     if (!target.contains(relatedTarget)) this.groupHasFocus = false; | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
|   @action |   @action | ||||||
|   handleArrowUp() { |   handleArrowUp() { | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| <div | <div | ||||||
|   class='relative border border-gray-400 |   class='relative border border-gray-400 | ||||||
|     {{if (and @groupHasFocus (eq @currentIndex @selectedIndex)) 'border-orange-400'}}'> |   {{if (and @groupHasFocus (eq @currentIndex @selectedIndex)) 'border-orange-400'}}'> | ||||||
|   {{#if (and @groupHasFocus (eq @currentIndex @selectedIndex))}} |   {{#if (and @groupHasFocus (eq @currentIndex @selectedIndex))}} | ||||||
|     <button |     <button | ||||||
|       role="button" |       role="button" | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Ava Wroten
						Ava Wroten