wickedest / Mergely

Merge and diff documents online
http://www.mergely.com
Other
1.17k stars 228 forks source link

options() - Unexpected results when setting then getting options #209

Closed Scott-Poole closed 1 month ago

Scott-Poole commented 1 month ago

Setup:

Steps to reproduce:

  1. run examples sever
  2. navigate to /editor.html example page
  3. In the options dropdown menu toggle ON view sidebars, wrap lines, and line numbers.
  4. open up dev tools/console (F12 on most browsers)
  5. run mergely.options() in the console to inspect current options
  6. verify wrap_lines: true, line_numbers: true, sidebar: true
  7. In the options dropdown menu toggle OFF view sidebars
  8. run mergely.options() in the console to inspect current options
  9. verify wrap_lines: true, line_numbers: true, sidebar: false
  10. In the options dropdown menu toggle OFF wrap lines
  11. run mergely.options() in the console to inspect current options
  12. Observe unexpected result wrap_lines: false, line_numbers: true, sidebar: true

Expected behavior:

When view sidebars and wrap lines are disabled then mergely.options() should return wrap_lines: false, sidebar: false

Actual result:

Setting the option wrap lines to off causes mergely.options() to report the option sidebar: true

Impact - Low. The editor still behaves as the user would expect.

Benefit of fixing - The current workaround involves maintaining the state of the mergely options locally. Developing with mergely would be simpler if options() would reflect the current options as the documentation describes.

options(options?: [object])

Gets or sets the editor [Options](https://mergely.com/doc#options). With no arguments, the function will return the currently configured options. When supplied options to change, the editor will automatically update with the new settings.
github-actions[bot] commented 1 month ago

:tada: This issue has been resolved in version 5.3.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

wickedest commented 1 month ago

Fixed - @Scott-Poole , tyvm for reporting the issue ⭐