Skip to content

Commit 402fd58

Browse files
authored
Merge pull request #1432 from vtex/add/prevdefault-numstepper
fix: NumericStepper redirecting to product page when inside a shelf
2 parents 729a610 + 2e8e301 commit 402fd58

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
### Fix
11+
12+
- **NumericStepper** redirecting to product page when inside a shelf, added a preventDefault.
13+
1014
## [9.146.2] - 2022-09-02
1115

1216
### Fixed
@@ -4157,4 +4161,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
41574161

41584162

41594163
[Unreleased]: https://github.com/vtex/styleguide/compare/v9.146.1...HEAD
4160-
[9.146.1]: https://github.com/vtex/styleguide/compare/v9.146.0...v9.146.1
4164+
[9.146.1]: https://github.com/vtex/styleguide/compare/v9.146.0...v9.146.1

react/components/NumericStepper/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,13 @@ class NumericStepper extends Component {
186186

187187
handleIncreaseValue = event => {
188188
event.stopPropagation()
189+
event.preventDefault()
189190
this.changeValue(this.state.value + 1, event, false)
190191
}
191192

192193
handleDecreaseValue = event => {
193194
event.stopPropagation()
195+
event.preventDefault()
194196
this.changeValue(this.state.value - 1, event, false)
195197
}
196198

0 commit comments

Comments
 (0)