Skip to content

Commit 953753b

Browse files
fix(iOS): drawing checkboxes (#609)
# Summary Fix drawing checkboxes ## Test Plan 1. create input without styles 2. add checkbox list 3. heigh of checkbox should align with text line rect ## Screenshots / Videos https://github.com/user-attachments/assets/45c35ded-e92c-4e83-b811-607bb076daea ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ✅ | | Android | ❌ | ## Checklist - [ ] E2E tests are passing - [ ] Required E2E tests have been added (if applicable)
1 parent 74bdc7e commit 953753b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

ios/extensions/LayoutManagerExtension.mm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,14 @@ - (void)drawCheckbox:(id<EnrichedViewHost>)host
406406
UIImage *image = isChecked ? host.config.checkboxCheckedImage
407407
: host.config.checkboxUncheckedImage;
408408
CGFloat gapWidth = [host.config checkboxListGapWidth];
409-
CGFloat boxSize = [host.config checkboxListBoxSize];
409+
CGFloat configuredBoxSize = [host.config checkboxListBoxSize];
410410

411+
CGFloat boxSize = MIN(configuredBoxSize, usedRect.size.height);
411412
CGFloat centerY = CGRectGetMidY(usedRect) + origin.y;
412413
CGFloat boxX = origin.x + indent - gapWidth - boxSize;
413414
CGFloat boxY = centerY - boxSize / 2.0;
414415

415-
[image drawAtPoint:CGPointMake(boxX, boxY)];
416+
[image drawInRect:CGRectMake(boxX, boxY, boxSize, boxSize)];
416417
}
417418

418419
- (void)drawBullet:(id<EnrichedViewHost>)host

0 commit comments

Comments
 (0)