[Fixed] Intermediate checkbox

I am trying to configure a checkbox to have an intermediate state. From reading the documentation, this sounded like an easy task. I have read through the forums and not found anything about it either (probably because it really is easy, and I am missing something). I found this post (Indeterminate checkboxes), but it seems to predate what is currently built into anvil.

I have tried programmatically creating the checkbox and using the gui editor to set the allow_intermediate property to True.

Code Sample:

self.check_box_1.allow_indeterminate = True
self.check_box_1.checked = None

Any help would be appreciated. I could find another solution to what I am working on, but this would be the most elegant.

I don’t think you’re missing anything. In a Material Design theme, the checkbox will show with a dash inside of it. In the Material Design 3 theme, there doesn’t seem to be a difference between unchecked and the indeterminate state.

Hopefully someone good with CSS can suggest a fix for this.

Good spot, adding this to your theme.css for a material3 theme should fix things

.checkbox input:indeterminate:before {
  font-family: "FontAwesome";
  content: "\f068";
  font-size: 10px;
}
2 Likes

Should this also go to bug reports to have that corrected in the Material Design 3 theme?

1 Like

@stucork and @jshaffstall Thanks guys. That was a big help.

1 Like