[Button] should toggle with state function
See original GitHub issueIt seems that toggle button is broken since 2.3.1 version, all was good for toggle buttons in 2.3.0
Steps
<a class="ui toggle button">Toggle</a>
<script>$(".ui.button.toggle").state();</script>
Expected Result
a toggle button…
Actual Result
Uncaught TypeError: $(...).state is not a function
at HTMLDocument.<anonymous>
Version
Semantic ui 2.3.1 (cdnjs) jQuery 3.3.1
Testcase
https://jsfiddle.net/jcheron/n90gcwjz/2/
Note
Version 2.3.1 available at https://semantic-ui.com/dist/semantic.min.js works, while cdn (cdnjs or cdn.jsdelivr.net) does not work.
The files are different!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:12
Top Results From Across the Web
Should a toggle button show its current state or the state to ...
Toggle buttons are fine for things which have exactly one bit of state and it can be controlled directly by the button. I...
Read more >Toggle State With React Hooks - Magnificode
Create a basic toggle function using React Hooks. ... we should see our state change from false to true once the button is...
Read more >Toggling button state and reusing toggle function for other ...
I solved this problem using a hash to maintain the states. toggleView(key, event) { const button_states_hash = Object.assign({}, ...
Read more >Toggle state on and off with React Hooks - Josh W Comeau
A button can be clicked to increment a counter bit of state. Whenever that button is clicked, App will re-render. Because SomeBigComponent is ......
Read more >How to Create a Toggle Button in React Using Conditional ...
In React, to manage the local state, we have to use the hooks inside of the functional component. You can't just simply update...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In case the reason has not been resolved and for those who want an interim patch - this is because the 2.3.1 package does not have state.js and state.min.js files - just a build issue. I copied the files from 2.3.0 as a temp fix and yay all sorted.
The 2.3.2 package still does not include the state module which has disappeared since 2.3.1
This is unfortunate because semantic-ui is unusable via all cdns. It is necessary to add the latest available version of state.js manually: