Преглед изворни кода

Merge pull request #220 from smiclea/fix-alert

Fix `Enter` key ignore in some confirmation modals
Dorin Paslaru пре 8 година
родитељ
комит
c7f0e0ce44
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/components/organisms/AlertModal/index.jsx

+ 1 - 1
src/components/organisms/AlertModal/index.jsx

@@ -74,7 +74,7 @@ class AlertModal extends React.Component<Props> {
   id: string
   id: string
 
 
   componentDidMount() {
   componentDidMount() {
-    this.id = new Date().getTime().toString()
+    this.id = `${new Date().getTime().toString()}-${Math.random()}`
     KeyboardManager.onEnter(`alert-${this.id}`, () => {
     KeyboardManager.onEnter(`alert-${this.id}`, () => {
       if (this.props.isOpen) {
       if (this.props.isOpen) {
         this.props.onConfirmation()
         this.props.onConfirmation()