In order to improve clarity around our boolean props, I proposed that they all be phrased as a positive statement. At times this can be suboptimal when authoring JSX, but I think the clarity of intent is worth it.
| Current | Proposed |
| ------------- |-------------------|
| Draggable > disableInteractiveElementBlocking | canDragInteractiveElements |
| Draggable > isDragDisabled | isDragEnabled |
| Droppable > isDropDisabled | isDropEnabled |
| Droppable > ignoreContainerClipping | allowContainerClipping (name to be improved) |
All the other booleans already express positive intent.
The existing default behaviours would not change (although the raw default value would)
Nice improvement.
useContainerCIipping sounds like it鈥檚 a hook though. I would suggest something like constraintByClippingBounds.
I don't know if I have enough understanding to vote yet. Would this be backwards compatible? Would this be a breaking change in the sense that for every time I would like drop to be enabled, I would need to go back and add that? It seems like the tradeoff is that all of the defaults would change?
If it's backwards compatible and doesn't require changing the defaults for every prop, I think I'm a 馃憤
I haven't fully made up my mind on this, but I've come to prefer HTML's convention for boolean terminology for consistency reasons (for props only).
<button disabled />
<input checked />
Yes, I know you lose the boolean type hint in the name itself with this technique, but I like that it's consistent with the native element attributes.
However, there's also another reason, when you use boolean shorthand, the is seems to "beg" a question rather than "be" a property itself of the component itself - sometimes only when it begins the phrase though.
Question vs property:
// A question, but there's no value to answer it?
<Draggable isDragDisabled />
// This would be a property itself
<Draggable dragIsDisabled />
HTML convention:
<Draggable dragDisabled />
<Droppable containerClipping />
As I said I don't know what to fully think about this yet, but I thought I'd leave it here since I thought about it as well a couple months ago.
Most helpful comment
I haven't fully made up my mind on this, but I've come to prefer HTML's convention for boolean terminology for consistency reasons (for props only).
Yes, I know you lose the boolean type hint in the name itself with this technique, but I like that it's consistent with the native element attributes.
However, there's also another reason, when you use boolean shorthand, the
isseems to "beg" a question rather than "be" a property itself of the component itself - sometimes only when it begins the phrase though.Question vs property:
HTML convention:
As I said I don't know what to fully think about this yet, but I thought I'd leave it here since I thought about it as well a couple months ago.