Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(comp:button): buttonGroup disabled not working #1510

Closed
wants to merge 1 commit into from

Conversation

sallerli1
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added/updated or not needed
  • Docs and demo have been added/updated or not needed

What is the current behavior?

buttonGroup设置 disabled,button实际未禁用

What is the new behavior?

修复以上问题

Other information

@@ -98,7 +99,7 @@ export default defineComponent({
)
}
return (
<button class={classes.value} disabled={disabled || loading} type={type} onClick={handleClick}>
<button class={classes.value} disabled={disabled.value || loading} type={type} onClick={handleClick}>
{children}
{!mergedWaveless.value && <ɵWave ref={waveRef} />}
</button>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code review:

  1. In line 30 and 31, the 'disabled' variable was added to make the code more readable. This is a good practice and it should be kept.

  2. The 'disabled' variable is used in line 51 and 52 to set the class of the button. This is correct and should not be changed.

  3. In line 62, the 'disabled' property is used in the handleClick function to prevent click events from firing when the button is disabled or loading. This is a good practice and should be kept.

  4. In line 98, the 'disabled' property is used to set the disabled attribute of the button element. This is also correct and should be kept.

@idux-bot
Copy link

idux-bot bot commented Mar 24, 2023

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Merging #1510 (d57bf67) into main (703122f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head d57bf67 differs from pull request most recent head 2def74f. Consider uploading reports for the commit 2def74f to get more accurate results

@@           Coverage Diff           @@
##             main    #1510   +/-   ##
=======================================
  Coverage   92.75%   92.75%           
=======================================
  Files         331      331           
  Lines       30801    30802    +1     
  Branches     3533     3534    +1     
=======================================
+ Hits        28568    28569    +1     
  Misses       2233     2233           
Impacted Files Coverage Δ
packages/components/button/src/Button.tsx 95.41% <100.00%> (+0.04%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@danranVm
Copy link
Member

dup #1508

@danranVm danranVm closed this Mar 24, 2023
@sallerli1 sallerli1 deleted the fix-button-group-disabled branch July 4, 2024 09:27
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