Skip to content

fix: prevent DropdownMenuSwitchButton from calling onValueChange multiple times on Switch click#3046

Open
i-runets wants to merge 1 commit intodevelopfrom
fix/3045-DropdownMenuSwitchButton-onValueChange
Open

fix: prevent DropdownMenuSwitchButton from calling onValueChange multiple times on Switch click#3046
i-runets wants to merge 1 commit intodevelopfrom
fix/3045-DropdownMenuSwitchButton-onValueChange

Conversation

@i-runets
Copy link
Collaborator

Description:

Clicking the switch fired both the Switch’s handler and the row’s onClick (event bubbling), so onValueChange ran multiple times.

Fix: In the row’s handleClick, return early when the click target is inside the switch (using a ref), so only the Switch’s handler runs.

Issue link:

#3045

QA notes:

@github-actions
Copy link

github-actions bot commented Feb 27, 2026

Generated by: track-bundle-size
Generated at: Fri, 27 Feb 2026 12:19:40 GMT
Bundle size diff (in kBytes). Not gzipped. Both CSS & JS included.
Baseline: v6.3.1 (2025-12-03)
CI Status: ok

Module Baseline Size
(v6.3.1)
Size Diff Within
Threshold
Threshold
(min - max)
templateApp 693.09 693.51 +0.43
js:+0.21
css:+0.22
🆗 623.78 - 762.39
@epam/app 5586.96 5538.45 -48.51
js:-47.4
css:-1.11
🆗 5028.26 - 6145.65
@epam/electric 5.04 5.04 0
js:0
css:0
🆗 4.53 - 5.54
@epam/promo 55.61 55.57 -0.05
js:0
css:-0.05
🆗 50.05 - 61.17
@epam/uui-extra 0.21 0.21 0
js:0
css:0
🆗 0.19 - 0.23
@epam/loveship 92.81 96.27 +3.46
js:+3.49
css:-0.03
🆗 83.53 - 102.09
@epam/uui-components 257.49 259.5 +2.01
js:+1.02
css:+0.99
🆗 231.75 - 283.25
@epam/uui-core 324.75 327.49 +2.74
js:+2.74
css:0
🆗 292.27 - 357.23
@epam/uui-db 41.63 41.72 +0.08
js:+0.08
css:0
🆗 37.47 - 45.8
@epam/uui-docs 181.03 194.77 +13.75
js:+13.75
css:0
🆗 162.92 - 199.13
@epam/uui-editor 174.1 174.1 -0.01
js:-0.01
css:0
🆗 156.69 - 191.51
@epam/uui-timeline 75.5 75.5 +0
js:0
css:+0
🆗 67.95 - 83.05
@epam/uui 527.51 544.71 +17.2
js:+1.64
css:+15.56
🆗 474.76 - 580.26
new sizes (raw)

To set the sizes as a new baseline, you can copy/paste next content to the uui-build/config/bundleSizeBaseLine.json and commit the file.

{
  "version": "6.4.3",
  "timestamp": "2026-02-27",
  "sizes": {
    "templateApp": {
      "css": 257701,
      "js": 452458
    },
    "@epam/app": {
      "css": 719380,
      "js": 4951992
    },
    "@epam/electric": {
      "css": 2275,
      "js": 2883
    },
    "@epam/promo": {
      "css": 47756,
      "js": 9145
    },
    "@epam/uui-extra": {
      "css": 0,
      "js": 213
    },
    "@epam/loveship": {
      "css": 55348,
      "js": 43229
    },
    "@epam/uui-components": {
      "css": 24608,
      "js": 241121
    },
    "@epam/uui-core": {
      "css": 0,
      "js": 335352
    },
    "@epam/uui-db": {
      "css": 0,
      "js": 42718
    },
    "@epam/uui-docs": {
      "css": 2152,
      "js": 197291
    },
    "@epam/uui-editor": {
      "css": 12952,
      "js": 165320
    },
    "@epam/uui-timeline": {
      "css": 2203,
      "js": 75109
    },
    "@epam/uui": {
      "css": 214667,
      "js": 343113
    }
  }
}

Generated by: generate-components-api
CI Status: ok

Total amount of exported types/props without JSDoc comments

Amount
Types 335 (+0) 🆗
Props 220 (+0) 🆗

@i-runets i-runets force-pushed the fix/3045-DropdownMenuSwitchButton-onValueChange branch from ed0280b to b716d30 Compare February 27, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants