Shmew / Feliz.MaterialUI

Feliz-style Fable bindings for Material-UI
https://shmew.github.io/Feliz.MaterialUI/
MIT License
70 stars 19 forks source link

Where is the checked propery for radio? #41

Closed forki closed 4 years ago

forki commented 4 years ago

image

I can find a prop.isChecked, but that one is invalid

cmeeren commented 4 years ago

It's called checked'. Don't you get intellisense for it?

Shmew commented 4 years ago

I think that's because he was looking for it in prop and not radio, and the property is radio.checked'

cmeeren commented 4 years ago

Oh, right. Feliz.MaterialUI doesn't define anything in prop, that's from Feliz.

Zaid-Ajaj commented 4 years ago

From prop , it is called prop.isChecked

cmeeren commented 4 years ago

From prop , it is called prop.isChecked

That's a different prop. The MUI Radio component has its own checked prop.

forki commented 4 years ago

You lost me.

There is no "checked". could you please try to write a demo. This would also help further generations

cmeeren commented 4 years ago

Like this:

image

It's no different from any other MUI prop. Are you really not seeing it in your IDE?

image

forki commented 4 years ago

Ok did not see the prime. Thanks it works but please consider to put it in the docs. Thanks!

Christer van der Meeren notifications@github.com schrieb am Mo., 9. März 2020, 09:02:

Like this:

[image: image] https://user-images.githubusercontent.com/7766733/76193607-aceef280-61e4-11ea-887f-185a41e64573.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmeeren/Feliz.MaterialUI/issues/41?email_source=notifications&email_token=AAAOANHRIHJOZDZVFJDX6NTRGSPAXA5CNFSM4LDYGG5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOGBMYI#issuecomment-596383329, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOANAKHO4JMJT3ZOSJMJ3RGSPAXANCNFSM4LDYGG5A .

forki commented 4 years ago

image

seems something is still wrong

cmeeren commented 4 years ago

That's a different issue. How are you using radio.checked'?

forki commented 4 years ago

image

cmeeren commented 4 years ago

Hmm, weird. The code is literally a simple as this, I can't see anything wrong on Feliz.MaterialUI's end here:

image

My guess is the problem lies elsewhere, but I don't know where. Which versions of Feliz.MaterialUI and @material-ui/core are you using?

forki commented 4 years ago
Feliz.MaterialUI (0.13.1)
"@material-ui/core@^4.9.2"

inside of electron

cmeeren commented 4 years ago

Can you try replacing

radio.checked' config.SyncImagesOnlyWithWifi

with

prop.custom("checked", config.SyncImagesOnlyWithWifi)

If that also fails, the error is not in Feliz.MaterialUI.

forki commented 4 years ago

ok I'm offically confused now.

As you expected prop.custom("checked", config.SyncImagesOnlyWithWifi) did not make it work, BUT prop.custom("checked", config.SyncImagesOnlyWithWifi = true) did. So some additional check making it super explicitid that this a bool made it work. Is this a problem with some js prop types lib!? //cc @ncave

forki commented 4 years ago

Ok I found the reason. For some reason Sqlite is giving me 1 instead of a true. It never really is a problem because of js truthiness. But here it is. Anyway will try to work around that