diff --git a/docs/src/examples/addons/Radio/Types/RadioOnchangeExample.js b/docs/src/examples/addons/Radio/Types/RadioOnchangeExample.js new file mode 100644 index 0000000000..b15d25c621 --- /dev/null +++ b/docs/src/examples/addons/Radio/Types/RadioOnchangeExample.js @@ -0,0 +1,22 @@ +import React, { useState } from 'react' +import { Radio } from 'semantic-ui-react' + +const RadioOnChange = () => { + const [profileState, setProfileState] = useState(false) + + const handleChange = () => setProfileState(!profileState) + + return ( + <> +

{profileState ? 'Profile is visible' : 'Profile is invisible'}

+ + + ) +} + +export default RadioOnChange diff --git a/docs/src/examples/addons/Radio/Types/index.js b/docs/src/examples/addons/Radio/Types/index.js index 6e3524d089..f8f1e05543 100644 --- a/docs/src/examples/addons/Radio/Types/index.js +++ b/docs/src/examples/addons/Radio/Types/index.js @@ -6,6 +6,11 @@ import ExampleSection from 'docs/src/components/ComponentDoc/ExampleSection' const RadioTypesExamples = () => ( + { ) }) - it('is not called when on change when "id" is passed', () => { - const onChange = sandbox.spy() - wrapperMount() - - wrapper.find('label').simulate('mouseup') - wrapper.find('label').simulate('click') - onChange.should.have.not.been.called() - }) - it('is called when click is done on nested element', () => { const onChange = sandbox.spy() wrapperMount(Foo }} onChange={onChange} />) @@ -408,13 +399,6 @@ describe('Checkbox', () => { input: ['click'], }, }, - { - description: 'click on label with "id": fires on mouse click', - events: { - label: ['mouseup', 'click'], - }, - id: 'foo', - }, { description: 'click on input with "id": fires on mouse click', events: {