Skip to content

bug: Can't update editor's value via the updateTab method #714

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

Closed
mortalYoung opened this issue Mar 18, 2022 · 1 comment · Fixed by #750
Closed

bug: Can't update editor's value via the updateTab method #714

mortalYoung opened this issue Mar 18, 2022 · 1 comment · Fixed by #750
Assignees
Labels
bug Something isn't working

Comments

@mortalYoung
Copy link
Collaborator

Describe the bug

I have a modal to input some important informations, and then it'll generate a string from these informations, and after i close this modal, the string should type into the editor.

function() {
const handleSubmit = () => {
    molecule.editor.updateTab({
        id: current.tab.id,
       // update the editor's value by str
       data: Object.assign(current.tab.data,{value: str})
    })
}
return(
    <Modal onSubmit={handleSubmit}>
    ...
    </Modal>
)
}

Versions

  • OS: MacOS
  • Browser: Chrome
  • Molecule: @0.9.0-beta.4.2

To reproduce

Expected

  • the editor's content replaced by the str

Actually happening

  • there is no changes in editor's content
@mortalYoung mortalYoung added the bug Something isn't working label Mar 18, 2022
@mortalYoung
Copy link
Collaborator Author

mortalYoung commented Mar 18, 2022

知道了 应该用

molecule.editor.editorInstance.getModel().setValue(str);

@wewoor wewoor mentioned this issue Apr 25, 2022
13 tasks
@Zaoei Zaoei mentioned this issue May 24, 2022
8 tasks
mumiao pushed a commit that referenced this issue May 26, 2022
* feat: when the editor text changes, restrict updates through Uri comparison

* fix: update the editor value with the updateTab method (#714)

* test: add setGroupEditorValue test case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants