Coder Social home page Coder Social logo

Comments (7)

sicbe avatar sicbe commented on August 25, 2024 1

Ok so stupid... :-( I missed this part.

use HasConditionalContainer; // Important!!

from conditional-container.

milewski avatar milewski commented on August 25, 2024

If am not mistaken boolean field yield a value yes and no instead of true/false can you try

ConditionalContainer::make([...])->if(field === yes)

I can double-check it in an hour or so


Edit

What package are you using? is it the native Boolean::make() field that ships with nova? or some third party package?

from conditional-container.

milewski avatar milewski commented on August 25, 2024

I just tested using the native nova Boolean field and it worked:

Boolean::make('Test',' 'test'),
ConditionalContainer::make([...])->if(test == 1),
ConditionalContainer::make([...])->if(test truthy true)

from conditional-container.

sicbe avatar sicbe commented on August 25, 2024

Default Boolean yes...

I've got this. Toggling the checkbox does nothing. Maybe doing something wrong somewhere...

... Boolean::make('Field', 'field')->hideFromDetail(), ConditionalContainer::make([ Markdown::make('Content', 'content')->hideFromIndex()->hideFromDetail(), Text::make('Name', 'name')->hideFromIndex()->hideFromDetail(), Text::make('email', 'email')->hideFromIndex()->hideFromDetail(), ])->if('field truthy true'), ...

from conditional-container.

milewski avatar milewski commented on August 25, 2024

I'm not sure whats the issue on your case, I just copy/paste your sample fields and it worked:

image

Perhaps you are not on the latest versions? Nova 2.5.0 ConditionalContainer v1.0.4

from conditional-container.

sicbe avatar sicbe commented on August 25, 2024

Maybe I'm doing something else wrong. I tried with different conditions like:

Text::make('Naam'), ConditionalContainer::make([ Text::make('test'), ])->if('naam = test'),

Doesn't seem to be the problem of the Boolean because none of the conditions I try will work. Will do some experimenting to see if I can find out why...

The versions are the latest so that won't be the problem.

from conditional-container.

milewski avatar milewski commented on August 25, 2024

I see yeah that trait is important! Perhaps later I will add a note on Readme empathizing the need of that trait

from conditional-container.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.