question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Button] should toggle with state function

See original GitHub issue

It 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:open
  • Created 5 years ago
  • Reactions:5
  • Comments:12

github_iconTop GitHub Comments

3reactions
certainlysylviacommented, May 31, 2018

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.

1reaction
jcheroncommented, Jun 23, 2018

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:

<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.0/components/state.min.js"></script>
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found