Skip to content

Conversation

@kacperzolkiewski
Copy link
Collaborator

@kacperzolkiewski kacperzolkiewski commented Jan 13, 2026

Summary

Fixes: #248
Add support for checkbox list.

Test Plan

Play with checkbox list in example app.

Screenshots / Videos

Screen.Recording.2026-01-16.at.12.11.44.mov

Compatibility

OS Implemented
iOS
Android

@kacperzolkiewski kacperzolkiewski changed the base branch from main to @exploif/checklist January 13, 2026 08:03
@kacperzolkiewski kacperzolkiewski changed the title Add checklist feat: Add checklist Jan 16, 2026
@kacperzolkiewski kacperzolkiewski changed the title feat: Add checklist feat(iOS): Add checklist Jan 16, 2026
@kacperzolkiewski kacperzolkiewski marked this pull request as ready for review January 16, 2026 11:13
@kacperzolkiewski kacperzolkiewski changed the title feat(iOS): Add checklist feat(iOS): Add checkbox list Jan 16, 2026
Base automatically changed from @exploif/checklist to main January 23, 2026 13:08
Copy link
Collaborator

@exploIF exploIF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well 🚀

Comment on lines +273 to +282
blockTap.textView = textView;
blockTap.input = self;
blockTap.cancelsTouchesInView = YES;
blockTap.delaysTouchesBegan = YES;
blockTap.delaysTouchesEnded = YES;

for (UIGestureRecognizer *gr in textView.gestureRecognizers) {
[gr requireGestureRecognizerToFail:blockTap];
}
[textView addGestureRecognizer:blockTap];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these could be done in some custom init on the TextBlockTapGestureRecognizer; one that would take input and of course the action, assign the input to a property, ran the initWithTarget base class method and then did all these operations. I think it would be much more clear.

[textView addGestureRecognizer:blockTap];
}

- (void)onTextBlockTap:(TextBlockTapGestureRecognizer *)gr {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this method somewhere lower; I think it should be in the same place as traitCollectionDidChange method - so in the section of delegate methods and likewise.

}
}

textView.selectedRange = NSMakeRange(endOfLineIndex, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add some comment describing why this seleciton fix is needed and what case was happening without it.

Comment on lines +620 to +627
// Draw Checkmark
UIBezierPath *checkPath = [UIBezierPath bezierPath];
CGFloat startX = insetRect.origin.x + insetRect.size.width * 0.25;
CGFloat startY = insetRect.origin.y + insetRect.size.height * 0.5;
CGFloat midX = insetRect.origin.x + insetRect.size.width * 0.45;
CGFloat midY = insetRect.origin.y + insetRect.size.height * 0.65;
CGFloat endX = insetRect.origin.x + insetRect.size.width * 0.75;
CGFloat endY = insetRect.origin.y + insetRect.size.height * 0.35;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart, but crazy at the same time to manually draw a checmark 😮

leading:YES
trailing:NO];
fixedHtml = [self stringByAddingNewlinesToTag:@"<li>"
fixedHtml = [self stringByAddingNewlinesToTag:@"<li"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay so I'm not sure about this one. It's there to specifically add newlines after all <li>. If we remove the >, it will start adding newlines in the middle of li tag content. I think we should rather separately do it for:

  • <li>
  • <li checked>

You can test it out by inputting a html like this;
<html><ul data-type=\"checkbox\"><li checked>something</li></ul></html>
to setHtml and I think there will be something wrong with newlines.

return self;
}

- (void)applyStyle:(NSRange)range {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a comment why it's a no-op.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants