Update hashtag menu to use Menu, convert to native link for additional a11y and click handling (#7529)
* Make tag a normal link on web * Replace old TagMenu with new RichTextTag component, expand and improve click utils * Clarify intents * Ensure we're passing down hint * ope * DRY
This commit is contained in:
+1
-13
@@ -1,4 +1,4 @@
|
||||
import {GestureResponderEvent, Linking} from 'react-native'
|
||||
import {Linking} from 'react-native'
|
||||
|
||||
import {isNative, isWeb} from './detection'
|
||||
|
||||
@@ -24,15 +24,3 @@ export function clearHash() {
|
||||
window.location.hash = ''
|
||||
}
|
||||
}
|
||||
|
||||
export function shouldClickOpenNewTab(e: GestureResponderEvent) {
|
||||
/**
|
||||
* A `GestureResponderEvent`, but cast to `any` to avoid using a bunch
|
||||
* of @ts-ignore below.
|
||||
*/
|
||||
const event = e as any
|
||||
const isMiddleClick = isWeb && event.button === 1
|
||||
const isMetaKey =
|
||||
isWeb && (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey)
|
||||
return isMetaKey || isMiddleClick
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user