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

[FIX] font_size_editor: dropdown and outline issues #5273

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from

Conversation

dhrp-odoo
Copy link
Contributor

@dhrp-odoo dhrp-odoo commented Nov 27, 2024

Description:

Issue 1:

Adjusting the font size with the mouse wheel while the dropdown is open caused the onChange event to trigger when clicking on a font size in the list, applying the wheel-adjusted font size, closing the dropdown, and preventing the selected size from being applied. Keeping the dropdown open resulted in the font size being set twice, which was also undesirable. To resolve this, the setSize function now uses a 100ms debounce, ensuring the font size is updated only once when both onChange and onClick events are triggered.

Issue 2:

The focus outline for the font size editor was not visible due to a global CSS reset in Odoo. To align with the design, the input outline has been removed in o-spreadsheet as well.

Task: 4357023

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

@robodoo
Copy link
Collaborator

robodoo commented Nov 27, 2024

Pull request status dashboard

Copy link
Contributor

@hokolomopo hokolomopo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋

src/components/font_size_editor/font_size_editor.ts Outdated Show resolved Hide resolved
src/components/font_size_editor/font_size_editor.ts Outdated Show resolved Hide resolved
@dhrp-odoo dhrp-odoo force-pushed the 17.0-fix-font-size-editor-bugs-dhrp branch from 91279df to 723dd3e Compare December 5, 2024 12:16
Copy link
Contributor

@hokolomopo hokolomopo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good !

tests/top_bar_component.test.ts Outdated Show resolved Hide resolved
Issue 1:
Adjusting the font size with the mouse wheel while the dropdown is
open caused the onChange event to trigger when clicking on a font size
in the list. This applied the wheel-adjusted font size, closed the
dropdown, and prevented the selected size from being applied. Keeping
the dropdown open resulted in the font size being set twice,
which was also undesirable.

To resolve this, the setSize function now uses a 100ms debounce.
This ensures the font size is updated only once when both onChange
and onClick events are triggered.

Issue 2:
The focus outline for the font size editor was not visible due to a
global CSS reset in Odoo. To align with the design, the input outline
has been removed in o-spreadsheet as well.

Task: 4357023
@dhrp-odoo dhrp-odoo force-pushed the 17.0-fix-font-size-editor-bugs-dhrp branch from 723dd3e to 513fdbf Compare December 10, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants