Skip to content
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

Default value for useComputedState is undefined but treated as true value. #4918

Closed
sculpt0r opened this issue Sep 29, 2021 · 1 comment · Fixed by #4940
Closed

Default value for useComputedState is undefined but treated as true value. #4918

sculpt0r opened this issue Sep 29, 2021 · 1 comment · Fixed by #4940
Labels
core The issue is caused by the editor core code. good first issue Relatively easy to fix. This is a perfect issue if you are willing to create a Pull Request. plugin:justify The plugin which probably causes the issue. plugin:list The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. type:bug A bug.
Milestone

Comments

@sculpt0r
Copy link
Contributor

Type of report

Bug

Provide detailed reproduction steps (if any)

Documentation says that default value for useComputedState is true. However, there is no place in the code that assigns true to this config option.

This option is used in justify plugin, which interprets the undefined value as true:

useComputedState = useComputedState === undefined || useComputedState;

This option is used in bidi plugin, which interprets the undefined value as true:

useComputedState = useComputedState === undefined || useComputedState;

This option is used in list plugin, which interprets the undefined value as true:

useComputedState = useComputedState === undefined || useComputedState;

Please note, that there are few other lines in those plugins, that use this 'trick'.

Code logic makes the value of config.useComputedState interpreted the same as the documentation says: as true value. However, If the user tries to use config.useComputedState, he will get undefined instead of true.

Expected result

What is the expected result of the above steps?
Plain config.useComputedState config option is equal to true.

Actual result

What is the actual result of the above steps?

Plain config.useComputedState config option is equal to undefined and interpreted as true.

Other details

  • Browser: -
  • OS: -
  • CKEditor version: 4.16.2 (it works like that since the option was introduced)
  • Installed CKEditor plugins: -
@sculpt0r sculpt0r added type:bug A bug. status:confirmed An issue confirmed by the development team. plugin:justify The plugin which probably causes the issue. plugin:list The plugin which probably causes the issue. core The issue is caused by the editor core code. size:S good first issue Relatively easy to fix. This is a perfect issue if you are willing to create a Pull Request. labels Sep 29, 2021
shabab477 pushed a commit to shabab477/ckeditor4 that referenced this issue Oct 24, 2021
shabab477 pushed a commit to shabab477/ckeditor4 that referenced this issue Nov 5, 2021
shabab477 pushed a commit to shabab477/ckeditor4 that referenced this issue Nov 19, 2021
Comandeer pushed a commit to shabab477/ckeditor4 that referenced this issue Nov 24, 2021
@CKEditorBot
Copy link
Collaborator

Closed in #4940

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core The issue is caused by the editor core code. good first issue Relatively easy to fix. This is a perfect issue if you are willing to create a Pull Request. plugin:justify The plugin which probably causes the issue. plugin:list The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. type:bug A bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants