Skip to content

Incorrect tooltip text wrapping logic #9947

@LappiLappland

Description

@LappiLappland

Check for duplicates

  • I have searched for similar issues before opening a new one.

Description

There are 2 issues with tooltip text wrapping logic:

  1. It doesn't respect limit if line has long word. Limit gets overwritten by longest word, which creates inconsistent tooltip width and may lead to tooltip width getting beyond screen width
  2. It has flawed logic for treating text containing new lines leading to inconsistent wrapping between these defined lines (better explained on screenshot 2)

Reproduction steps

  1. Programatically add tooltip text with long word (Not sure if long words may occur in simple Blockly, but developers are free to use setTooltip api on blocks, for example)

Priority

Very minor issue, but an issue nonetheless

Stack trace

Screenshots

  1. Long single word example
Image
  1. Inconsistent wrapping with text that has new lines
Image

Browsers

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bugDescribes why the code or behaviour is wrongissue: triageIssues awaiting triage by a Blockly team member

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions