From f74cd1aa3f78004d0393cfd0d1c89e73804106ac Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Wed, 6 Mar 2019 12:49:57 -0330 Subject: Prevent advanced gas input arrows from setting value to < 0 (#6248) --- .../advanced-gas-inputs/advanced-gas-inputs.component.js | 14 ++++++++++++-- .../advanced-tab-content/advanced-tab-content.component.js | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'ui') diff --git a/ui/app/components/gas-customization/advanced-gas-inputs/advanced-gas-inputs.component.js b/ui/app/components/gas-customization/advanced-gas-inputs/advanced-gas-inputs.component.js index f0abff478..95894140c 100644 --- a/ui/app/components/gas-customization/advanced-gas-inputs/advanced-gas-inputs.component.js +++ b/ui/app/components/gas-customization/advanced-gas-inputs/advanced-gas-inputs.component.js @@ -80,8 +80,18 @@ export default class AdvancedTabContent extends Component { 'advanced-gas-inputs__gas-edit-row__input--error': isInError && errorType === 'error', 'advanced-gas-inputs__gas-edit-row__input--warning': isInError && errorType === 'warning', })}> -
onChange(value + 1)}>
-
onChange(value - 1)}>
+
onChange(value + 1)} + > + +
+
onChange(Math.max(value - 1, 0))} + > + +
{ isInError ?
diff --git a/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js b/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js index 366ad88c9..a3a3f96d8 100644 --- a/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js +++ b/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js @@ -88,8 +88,18 @@ export default class AdvancedTabContent extends Component { 'advanced-tab__gas-edit-row__input--error': isInError && errorType === 'error', 'advanced-tab__gas-edit-row__input--warning': isInError && errorType === 'warning', })}> -
onChange(value + 1)}>
-
onChange(value - 1)}>
+
onChange(value + 1)} + > + +
+
onChange(Math.max(value - 1, 0))} + > + +
{ isInError ?
-- cgit v1.2.3