Skip to content

Commit

Permalink
fix: prevent period SC to trigger on change when selected item is cli…
Browse files Browse the repository at this point in the history
…cked
  • Loading branch information
martinkrulltott committed Mar 12, 2024
1 parent bd00f95 commit a84d44e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cypress/helpers/period.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ const selectRelativePeriod = ({ label, period }) => {

const unselectAllPeriods = ({ label }) => {
openPeriod(label)
cy.contains('Choose from presets').click()

cy.getBySel('period-dimension-transfer-actions-removeall').click()
cy.getBySel('period-dimension-modal-action-confirm').click()
}
Expand Down
6 changes: 4 additions & 2 deletions src/components/Dialogs/PeriodDimension/PeriodDimension.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@ export const PeriodDimension = ({ dimension, onClose }) => {
}

const onSegmentedControlChange = ({ value }) => {
setEntryMethod(value)
updatePeriodDimensionItems([])
if (value !== entryMethod) {
setEntryMethod(value)
updatePeriodDimensionItems([])
}
}

return dimension ? (
Expand Down

0 comments on commit a84d44e

Please sign in to comment.