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: radio): incomplete consideration of controlled mode #744

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

liuzaijiang
Copy link
Contributor

@liuzaijiang liuzaijiang commented Jan 27, 2022

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

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Component style update
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Application (the showcase website) / infrastructure changes
  • Other... Please describe:

What is the current behavior?

<template>
  <IxRadio :checked="checked" @change="change">Checked: {{ checked }}</IxRadio>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const checked = ref(false)
const change = console.log
</script>

在受控模式下,当radio点击一次后,change事件不再触发;

原因:原生radio不是受控组件,所以当你点击一次之后,原生的input其实已经被选中,再次点击不会被触发

What is the new behavior?

组件支持完全受控,当radio没有被选中时,change事件可以一直触发

Other information

@idux-bot
Copy link

idux-bot bot commented Jan 27, 2022

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Jan 27, 2022

Codecov Report

Merging #744 (068efff) into main (3001bbd) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #744   +/-   ##
=======================================
  Coverage   83.18%   83.19%           
=======================================
  Files         461      461           
  Lines       12062    12066    +4     
  Branches     2872     2873    +1     
=======================================
+ Hits        10034    10038    +4     
  Misses       2028     2028           
Impacted Files Coverage Δ
packages/components/radio/src/Radio.tsx 87.30% <100.00%> (+0.86%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3001bbd...068efff. Read the comment docs.

packages/components/radio/src/Radio.tsx Outdated Show resolved Hide resolved
@danranVm danranVm merged commit 1a190bd into IDuxFE:main Feb 10, 2022
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