-
Notifications
You must be signed in to change notification settings - Fork 719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new(annotations/EditableAnnotation): add canEditSubject canEditLabel #919
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! looks good to me, except for a minor suggestion and a quick fix for the build
onTouchStart={subjectDrag.dragStart} | ||
onTouchMove={subjectDrag.dragMove} | ||
onTouchEnd={subjectDrag.dragEnd} | ||
cursor={subjectDrag.isDragging ? 'grabbing' : 'grab'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we want this cursor state to configurable? maybe through subjectDragHandleProps
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! {...subjectDragHandleProps}
is spread below this line so it should override cursor
(tho currently it doesn't have access to subjectDrag
state, is that what you meant?)
onTouchStart={labelDrag.dragStart} | ||
onTouchMove={labelDrag.dragMove} | ||
onTouchEnd={labelDrag.dragEnd} | ||
cursor={labelDrag.isDragging ? 'grabbing' : 'grab'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
|
||
describe('<EditableAnnotation />', () => { | ||
function setup() { | ||
function setup(props?: EditableAnnotationProps) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial<EditableAnnotationProps>
Pull Request Test Coverage Report for Build 371265698
💛 - Coveralls |
gonna merge this, happy to address any remaining concerns in another PR |
🚀 Enhancements
This PR adds the ability to specify whether one or both of the annotation subject or label are editable within
EditableAnnotation
, to support different use cases. Updates the demo to show this functionality.@kristw @hshoff