Skip to content

Conversation

@ZeeshanTamboli
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli commented Aug 15, 2025

In #46263, unnecessary optional chaining was added for handleKeyDown and handleKeyUp. These handlers are defined within the component. Optional chaining is only needed for the developer-provided onClick. We can keep the tests from #46263.

@ZeeshanTamboli ZeeshanTamboli added scope: chip Changes related to the chip. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. labels Aug 15, 2025
@mui-bot
Copy link

mui-bot commented Aug 15, 2025

Netlify deploy preview

https://deploy-preview-46752--material-ui.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/material ▼-4B(0.00%) ▼-1B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 8fcc7b7

@ZeeshanTamboli ZeeshanTamboli merged commit 9249509 into mui:master Aug 16, 2025
21 checks passed
@ZeeshanTamboli ZeeshanTamboli deleted the chip-remove-unnecessary-optional-chaining-from-key-event-handlers branch August 16, 2025 06:19
cursor bot pushed a commit to sai6855/material-ui that referenced this pull request Aug 18, 2025
Similar to the improvements in PR mui#46752, this removes unnecessary
optional chaining from internal handleKeyDown and handleKeyUp function
calls in the Chip component. These functions are defined within the
same component and are guaranteed to exist, making the optional
chaining redundant.

The optional chaining for external handlers (handlers.onKeyDown?.) is
preserved as it remains necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: chip Changes related to the chip. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants