I feel like I should clarify that when I suggested
if new == "": return
it was not intended as a workaround or anything I would consider hacky. It’s the correct and appropriate way to handle this use case.
I hope a little context might shed light on why things are best as they are. As it is, the operation of callbacks is completely uniform and can be explained in once succinct statement:
Callbacks fire any time a Bokeh model property changes.
I hope everyone agrees that going from
"" constitutes a change. Additionally, all users, including the ones who do want to do something when the value is the empty string, can satisfy their needs. Contrast if we start adding special cases:
Callbacks fire any time a Bokeh model property change. Except for these special properties on these modes, that all each behave in these special different ways: .
Now the only way to know for sure what the behavior of a model actual is, is to dig through reference documentation. But worse, there is now an arbitrary limitation on capability that means that any users who do want to respond to the empty string no longer have any recourse to do so.