https://avo.cool logo
Hey guys! After version 3.25, all my booleans ...
# avo-3
b
m
Thread automatically created by Icaro Ryan Souza in #1138182212655788054
b
l
Hi @brainy-electrician-9993
There is a thread in discord for this but I couldn't reproduce it
Here
Since it's reproduceable on main demo I'll have a look at it
Thanks for sharing!
b
Thank you for sharing that thread! But those booleans are just regular booleans on our end
Also, a co-worker of mine didn't have this issue on his local. We also tried deploying a branch for testing and the issue didn't happen. But it's happening in the local for some of us
l
Yes, i think on @adamant-engineer-11143 use case is the same
b
So it seems inconsistent across different computers
We reset the cache and everything else
No result
l
Im on my phone right now
Just checked the city resource
And tue course one
And can't see any relevant differences
b
I got the html of them: * Course (https://main.avodemo.com/avo/resources/courses/147/edit?via_view=index) ✅
Copy code
<div class="flex-1 flex flex-row md:min-h-inherit px-6 py-2" data-slot="value">
    <div class="self-center w-full  md:w-8/12 has-sidebar:w-full ">
        
  <div class="h-8 flex items-center">
    <label class="relative flex items-center cursor-pointer" for="course_has_skills">
      <input name="course[has_skills]" type="hidden" value="0" autocomplete="off"><input value="1" data-action="input->resource-edit#toggle" data-resource-edit-toggle-target-param="skills_tags_wrapper" data-resource-edit-target="hasSkillsBooleanInput" data-course-resource-target="hasSkillsBooleanInput" data-toggle-fields-target="hasSkillsBooleanInput" style="" class="text-lg h-4 w-4 checked:bg-primary-400 focus:checked:!bg-primary-400 rounded" type="checkbox" checked="checked" name="course[has_skills]" id="course_has_skills">

</label>  </div>

    </div>
</div>
* City (https://main.avodemo.com/avo/resources/cities/2448/edit?via_view=index) ❌
Copy code
<div class="flex-1 flex flex-row md:min-h-inherit px-6 py-2" data-slot="value">
    <div class="self-center w-full  md:w-8/12 has-sidebar:w-full ">
        
  <div class="h-8 flex items-center">
    
      <input name="city[is_capital]" type="hidden" value="0" autocomplete="off"><input value="1" style="" class="text-lg h-4 w-4 checked:bg-primary-400 focus:checked:!bg-primary-400 rounded" type="checkbox" checked="checked" name="city[is_capital]" id="city_is_capital">

<label class="relative flex items-center cursor-pointer" for="city_is_capital">City is capital</label>  </div>

    </div>
</div>
l
Maybe it’s happening on a specific Rails version
But it’s “great” that we can reproduce it
l
We need to debug the boolean field components against both city and course resources
@brainy-electrician-9993 after a debug session I ended up with this PR that fixes the issue in our demo apps: https://github.com/avo-hq/avo/pull/4163 Could you please apply this patch on your side and confirm if it works?
b
I have applied the patch locally on my side and the fix indeed works great!! Thank you guys for addressing this so quickly
l
Awesome, thank you for confirming!
b
@loud-jewelry-99127 Did you ever find out why the bug wasn't happening all the time?
l
I found a diference between the Course and the City resource
the city field was being rendered from a custom tool using
avo_edit_field
but unfortunately I couldn't pinpoint the exact root cause
b
The kind of bug that comes and go but no one really knows why lol
l
I want to give it one more try
on your case how are the fields declared?
on a resource?
b
That's what's getting me so confused, they're just regular boolean fields:
field :active, as: :boolean
And the fact that it worked on one machine but not on the other got me wondering a lot
l
Might be a browser issue?
now this is unexpected
b
I also thought so, but we tried in different browsers and the issue gets consistently fixed when I apply your changes
l
this print is when you're on last version or with the patch applied?
b
It's on the last version, without the fix
Your fix solves everything
Dont' know how, but it does haha
b
That one the escaping for the div is straight up crazy
Copy code
<div class="h-8 flex items-center">
    
      <input name="integration_endpoint[active]" type="hidden" value="0" autocomplete="off"><input value="1" data-resource-edit-target="activeBooleanInput" style="" class="text-lg h-4 w-4 checked:bg-primary-400 focus:checked:!bg-primary-400 rounded sr-only peer" type="checkbox" checked="checked" name="integration_endpoint[active]" id="integration_endpoint_active">

        <div class="block w-10 h-6 rounded-full bg-gray-300 peer-checked:bg-green-500"></div>
        <div class="dot absolute left-1 top-1 bg-white w-4 h-4 rounded-full transition-transform duration-200 transform peer-checked:translate-x-4"></div>
<label class="relative flex items-center cursor-pointer" for="integration_endpoint_active">        <div class="block w-10 h-6 rounded-full bg-gray-300 peer-checked:bg-green-500"></div>
        <div class="dot absolute left-1 top-1 bg-white w-4 h-4 rounded-full transition-transform duration-200 transform peer-checked:translate-x-4"></div>
</label>  </div>
></div>
WTF loll
l
Let me know if you find something, i'll try to pinpoint is as well when i get some spare minutes