本網站在啟用 JavaScript 的情況下可以運作的更好。
首頁
探索
說明
登入
abunchtell
/
mastodon
關注
1
收藏
0
複製
0
程式碼
問題
0
活動
瀏覽代碼
Additional key checks for browser compatibility (
#2539
)
Not all browsers recognize e.key === 'Escape'; some use 'Esc' and some only respond to the keyCode.
master
Noëlle Anthony
7 年之前
committed by
Matt Jankowski
父節點
2e47fe3e1a
當前提交
c67d3c990b
共有
1 個檔案被更改
,包括
2 行新增
和
1 行删除
分割檢視
Diff Options
Show Stats
Download Patch File
Download Diff File
+2
-1
app/assets/javascripts/components/features/ui/components/modal_root.jsx
+ 2
- 1
app/assets/javascripts/components/features/ui/components/modal_root.jsx
查看文件
@@ -22,7 +22,8 @@ class ModalRoot extends React.PureComponent {
}
handleKeyUp (e) {
if (e.key === 'Escape' && !!this.props.type) {
if ((e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27)
&& !!this.props.type) {
this.props.onClose();
}
}
Write
Preview
Loading…
取消
儲存