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

The editing state of a-typography cannot be disabled #5743

Closed
1 task done
hangvane opened this issue Jun 23, 2022 · 1 comment
Closed
1 task done

The editing state of a-typography cannot be disabled #5743

hangvane opened this issue Jun 23, 2022 · 1 comment
Labels

Comments

@hangvane
Copy link

hangvane commented Jun 23, 2022

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.2.6

Environment

vue 3.2.37, antdv 3.2.7(latest)

Reproduction link

Edit on CodeSandbox

Steps to reproduce

<a-typography-text
:editable="editableVar? {editing: false,}: false"
>
This is a typography...
</a-typography-text>

With the combinational adoption of boolean value and editing attribute of :editable, the editing state of typography cannot be forced to disable.

  1. Change the value to editableVar===true
  2. Click the edit icon of typography
  3. Change the value back to editableVar===false

What is expected?

The editing mode of typography should not be activated.
image

What is actually happening?

The editing mode is activated at last.
image


I am trying to add a re-random icon to a typography. Since antdv does not provide fully customized API to add a brand new icon to a typography, I have to reuse the editable icon to build this function. The default behavior of editable icon should be prevented, that is, the click of editable icon should NOT ACTIVATE the editing mode of typography. It works good when the editing: false is set for editable. However, when editable is set to editable===false, editing: false can not be set to editable at the same time to prevent the editing mode. Meanwhile, it seems that typography has some extra internal states that is activated when the editable icon is clicked, and activate the editing mode when editable is set to editable === false.

This bug can be fixed by adding more conditional judgment, to prevent the editing mode to be accidentally activated when editable===false, or enhance the onStart API to provide a way to prevent the default behavior of editable icon, or adding fully customized API for customizing a brand new icon with independent interactive logic.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant