Can not reset chart priceFormatter if added a custom one
Lightweight Charts™ Version:latest(5.0.7)
Steps/code to reproduce:
Hey, team, I've encountered a strange behavior of the chart price formatter. Though not completely certain whether is it expected behavior or not.
When i've added priceFormatter to the chart by applying options (options.localization.priceFormatter) i actually can not remove it later. I'm trying to remove it by applying new options where the price formatter is set to undefined. But this takes no effect. Please consider to look on sandbox link provided. On button click i'm trying to reset chart formatter, but it still uses the previous one.
Actual behavior:
Even if chart options are changed and options.localization.priceFormatter set to undefined, the changes are not reflected on the price scale. Formatter is still applied.
Expected behavior:
Price formatter is removed and default price display rules are applied when formatter is set to undefined.
CodeSandbox/JSFiddle/etc link:
https://stackblitz.com/edit/vitejs-vite-z1yv3ft3?file=src%2Fmain.ts
Source: tradingview/lightweight-charts