-
Notifications
You must be signed in to change notification settings - Fork 6.8k
docs(chips): make separatorKeysCodes readonly #11830
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
docs(chips): make separatorKeysCodes readonly #11830
Conversation
Make separatorKeysCodes readonly because it isn't changed after component is intialized.
@@ -17,7 +17,7 @@ export class ChipsInputExample { | |||
addOnBlur: boolean = true; | |||
|
|||
// Enter, comma | |||
separatorKeysCodes = [ENTER, COMMA]; | |||
readonly separatorKeysCodes = [ENTER, COMMA]; |
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.
Is there a strong reason to do this in the example?
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.
In the example, it looks like the key codes are essentially constants, so I think it would make sense if we add the readonly modifier. The motivation for this change proposal came from a teammate who copy pasted the code from the example and interpreted the example code as best practices (i.e. omitting the readonly).
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.
LGTM
@jhuang314 Could you please rebase? Thanks! |
Hi @jhuang314! This PR has merge conflicts due to recent upstream merges. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Make separatorKeysCodes readonly because it isn't changed after component is intialized.