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 newly inserted leaf element cannot immediately update the color attribute in the style #3412

Open
tomdyqin opened this issue Aug 1, 2024 · 0 comments
Labels
bug Something isn't working ime

Comments

@tomdyqin
Copy link
Contributor

tomdyqin commented Aug 1, 2024

Description

The newly inserted leaf element cannot immediately update the color attribute in the style

my solution:

        renderLeaf={((props) => {
          // FIXME
          if (props.leaf.color && props.leaf.color !== (props as any).style.color) {
            (props as any).style.color = props.leaf.color;
          }
          return <DefaultLeaf editor={editor} {...props} />;
        })}

Reproduction URL

No response

Reproduction steps

1. Go to 'editor'
2. Click on 'text color' to colorA
3. Input some word 'aaa'
4. Click on 'text color' to colorB
5. Input some another word needs to be combined (such as Chinese) 'zhong'wen'
4. See color before compositionend

Plate version

^31.4.4

Slate React version

^0.102.0

Screenshots

compositionstart:
11

compositionend:
333

Logs

No response

Browsers

No response

@tomdyqin tomdyqin added the bug Something isn't working label Aug 1, 2024
@felixfeng33 felixfeng33 added the ime label Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ime
Projects
None yet
Development

No branches or pull requests

2 participants