fix: set checked in constructor #62

Closed
felixroos wants to merge 1 commit from fix-checkbox-example into master
felixroos commented 2023-09-28 22:12:46 +02:00 (Migrated from github.com)

The checkbox example does not work properly when checked is not set in the constructor.

The checkbox example does not work properly when checked is not set in the constructor.
marijnh commented 2023-09-29 07:41:44 +02:00 (Migrated from github.com)

The readonly checked syntax in TypeScript means precisely this—initialize that property to the value of the argument. What makes you think it does not work?

The `readonly checked` syntax in TypeScript means precisely this—initialize that property to the value of the argument. What makes you think it does not work?
felixroos commented 2023-09-29 08:22:20 +02:00 (Migrated from github.com)

The readonly checked syntax in TypeScript means precisely this—initialize that property to the value of the argument. What makes you think it does not work?

Ah yes I was copy pasting into a plain js file, removing the typescript syntax afterwards.. I was not aware that typescript will turn that readonly constructor argument into an assignment. While this is a bit confusing for js users, it might not be a reason to change the example then.

> The `readonly checked` syntax in TypeScript means precisely this—initialize that property to the value of the argument. What makes you think it does not work? Ah yes I was copy pasting into a plain js file, removing the typescript syntax afterwards.. I was not aware that typescript will turn that readonly constructor argument into an assignment. While this is a bit confusing for js users, it might not be a reason to change the example then.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/website!62
No description provided.