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

Inconsistent default properties/style for "text" object #4818

Open
2 tasks done
ErikSwan opened this issue Dec 27, 2024 · 1 comment
Open
2 tasks done

Inconsistent default properties/style for "text" object #4818

ErikSwan opened this issue Dec 27, 2024 · 1 comment

Comments

@ErikSwan
Copy link

Preflight Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

You must agree to search and the code of conduct. You must fill in this entire template. If you delete part/all or miss parts out your issue will be closed.

If you are technical, you should report bugs along the lines of https://marker.io/blog/how-to-write-bug-report. If you are not technical, we will make allowances, please try to make an effort to understand the process.

Describe the bug
The default properties/style for a newly-created text object are different depending on how the text object is created. There are currently three different ways to create a new text object:

  1. Click (or click and drag) the text object from the shapes sidebar on the left
  2. Create a new text object from the upper toolbar (or via keyboard shortcut A)
  3. Double-click in blank space on the diagram and pick the text object from the pop-up menu that appears under the cursor

Each of these methods has a different default style for the created text object, which seems inconsistent and ripe for confusion. I would expect a new text object to have the same default properties/style regardless of how it is created (same for other shapes/objects/stencils).

I personally was confused why one text object I had added did not have resizing control handles (it had the "autosize" property set) while a different text object did, even though I didn't change any of the properties or styling of either text object.
 
To Reproduce
Steps to reproduce the behavior:

  1. Start a new blank diagram
  2. Create one text object by clicking the text object in the shapes sidebar on the left (under General)
  3. Create a second text object by using the keyboard shortcut A, or by selecting "Text" from the "+" drop-down menu in the toolbar
  4. Create a third text object by double-clicking in blank space and selecting the text object from the pop-up menu that appears under the cursor.
  5. Use Extras > Edit Diagram to view the source XML for the diagram, including the three different text objects.
  6. Note that the default styling/properties are different for each of the three text objects:
    1. The object created from the sidebar has:

      style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;"
      
    2. The object created from the toolbar/keyboard shortcut has:

      style="text;strokeColor=none;align=center;fillColor=none;html=1;verticalAlign=middle;whiteSpace=wrap;rounded=0;"
      
    3. The object created from the double-click under-cursor pop-up menu has:

      style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;"
      

If we break the style attributes out into one per line and sort them to make them easier to compare, it looks like this:

Sidebar                 Toolbar                 Double-click
~~~~~~~                 ~~~~~~~                 ~~~~~~~~~~~~
text;                   text;                   text;
align=center;           align=center;           align=center;
                                                autosize=1;
                        fillColor=none;         fillColor=none;
html=1;                 html=1;                 html=1;
                                                points=[];
                                                resizable=0;
rounded=0;              rounded=0;              
                        strokeColor=none;       strokeColor=none;
verticalAlign=middle;   verticalAlign=middle;   verticalAlign=middle;
whiteSpace=wrap;        whiteSpace=wrap;

The most immediately noticeable of these differences to the user is the fact that the text object created via the double-click pop-up menu has autosize=1, resizable=0, and is missing whiteSpace=wrap, so the container scales to the text and does not have resizing control handles, which is different than the other two cases.

Expected behavior
I would expect the default style/properties to be the exact same regardless of how the new text object is created, since there is nothing in the user interface to indicate that the text objects created via the three different methods described above will somehow be different.

draw.io version (In the Help->About menu of the draw.io editor):

  • draw.io Desktop 25.0.2

Desktop (please complete the following information):

  • OS: Windows 10 22H2

I tested the problem in incognito/private mode with all browser extensions switched off, write "yes" below:

  • Yes
@OysterP

This comment was marked as duplicate.

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

No branches or pull requests

2 participants