Преглед на файлове

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()