Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Peter Laurie 42 posts 116 karma points
    Oct 30, 2021 @ 06:46
    Peter Laurie
    0

    Toggle buttons not displaying state in CMS - Umbraco 9

    Hi, I am wondering if any one else has had this issue? In the CMS, for the toggle buttons, aria-checked is not being set to true when the value is true, and the class "umb-toggle--checked" is not being applied to the button. I have successfully ported our Umbraco 8 build to Umbraco 9, and up until now running locally, and running as localhost, this problem has not occurred, but now I run in dev and test the above is happening and you cannot tell if a button is on or off.

    Please see image below, the toggle buttons are not rendering correctly, and you cannot see if you have the option turned on or off. They are working as buttons, as I can change/display content, but you cannot see this in the CMS. There are no console errors but I wondered are there any permissions that need to be set that I am unaware of. I will soon take a look when I have https set up, so see if it is that. I have also added the static content mimeMaps to the IIS web config.

    Showing a typical toggle button

    The same button in a Macro in the settings area in Umbraco 9 or Umbraco 8

    Toggle button code on Umbraco 9 in IIS

    <button role="checkbox" aria-checked="" ng-click="click()" type="button" class="umb-toggle ng-scope ng-isolate-scope" ng-disabled="disabled" ng-class="{'umb-toggle--checked': checked, 'umb-toggle--disabled': disabled}" id="umb-toggle_b4defe77-f89c-4573-a2f9-02d27627f731" checked="checked" on-click="model.toggle('useInEditor')">
    

    Toggle button code in Umbraco 9 running as Localhost in Visual Studio

    <button role="checkbox" aria-checked="true" ng-click="click()" type="button" class="umb-toggle ng-scope ng-isolate-scope umb-toggle--checked" ng-disabled="disabled" ng-class="{'umb-toggle--checked': checked, 'umb-toggle--disabled': disabled}" id="umb-toggle_d4e9f676-a371-4e31-8185-190125aaf92e" checked="checked" on-click="model.toggle('useInEditor')">
    

    Toggle button code in Umbraco 8 in IIS

    <button role="checkbox" aria-checked="true" ng-click="click()" type="button" class="umb-toggle umb-toggle--checked" ng-disabled="disabled" ng-class="{'umb-toggle--checked': checked, 'umb-toggle--disabled': disabled}" id="umb-toggle_2a994d42-c01b-46f8-a8e8-3b3a7ea5a901" checked="checked" on-click="model.toggle('useInEditor')">
    

    What is the Angular JavaScript that changes the state of the toggle buttons and where do I start to look or has someone had the same issue?

    Thank you in advance for any help in resolving this issue, I cannot put Umbraco 9 in to production as a complete replacement for Umbraco 8 until this has been resolved.

    Kind regards, Pete

  • Peter Laurie 42 posts 116 karma points
    Nov 12, 2021 @ 04:45
    Peter Laurie
    0

    It was discovered that this issue was caused by a setting in WebMarkUpMin for .NET CORE not being present in the startup.cs options:

    options.MinificationSettings.AttributeQuotesRemovalMode = HtmlAttributeQuotesRemovalMode.KeepQuotes;
    

    This setting, when added resolved this issue and all on states of any toggle buttons can now be seen

Please Sign in or register to post replies

Write your reply to:

Draft