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

Can not make list for Chinese characters entered via input method on safari #458

Open
shadowzeng opened this issue Feb 28, 2024 · 1 comment

Comments

@shadowzeng
Copy link

My code (Vue component)

<template>
  <div>
    <div ref="editor"></div>
    <button @click="makeList">make list</button>
  </div>
</template>

<script>
import Squire from 'squire-rte';

export default {
  components: {},
  data () {
    return {
      editor: null
    };
  },
  mounted() {
    this.editor = new Squire(this.$refs.editor);
  },
  methods: {
    makeList() {
      this.editor.makeUnorderedList();
    }
  }
}
</script>

<style scoped>

</style>

it works on chrome
CleanShot 2024-02-28 at 14 52 21

but not on safari
CleanShot 2024-02-28 at 14 51 29

@neilj
Copy link
Member

neilj commented Mar 4, 2024

So the issue seems to be that Safari is stripping the <div> (or other block tag) around the content when it replaces the latin characters with the Chinese one. This means when we go to convert the block to a list, we can't find a block. Interestingly, it works fine if there's at least one other sibling block present. So if you hit Enter to create a new line and then tried, it works fine.

I'd say this is a Safari bug, and I don't really have a good solution right now, sorry.

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