Giter VIP home page Giter VIP logo

Comments (3)

justin-schroeder avatar justin-schroeder commented on May 28, 2024 1

@leewes thanks for filing this! I have to admit I’m a noob when it comes to IME’s of any kind and a bit unsure how to even begin testing them. Perhaps you could assist me somewhat. The mask input uses the beforeinput event — do you have any thoughts on how I could simulate an IME interaction to test what kind of events we are receiving at that event?

from formkit.

leewes avatar leewes commented on May 28, 2024

The mask input uses the beforeinput event — do you have any thoughts on how I could simulate an IME interaction to test what kind of events we are receiving at that event?

@justin-schroeder certainly! Though granted I'm also a bit new at this as well, so bear with me 😅

I'm not sure if there's a good way to simulate them without an IME.. From what I could tell by monitoring the element, IME inputs trigger composition events in addition to the key press, beforeInput, and input events.

Not sure if this might help, but I created a somewhat incomplete example in sandbox:

that generates an composition event with the data of the v-model-ed value of a Dispatched Event Data field and fires the set of events in order when the buttons below are clicked. Each button represents a key press in IME and fires them in the order observed from monitoring the input.

Example:
Generally the events are fired in this sort of sequence

  • start -> update (x times) -> end (from enter or clicking out)

for a string input like テスト it's

  1. composition start, the dispatched data is t on first key press in IME (key code is T)
  2. composition updates
  • The dispatched event data values on each following key press
    i. on second key press (key code is E)
    ii. テs on third key press (key code is S)
    iii. テス on fourth key press (key code is U)
    iv. テスt on fifth key press (key code is T)
    v. テスト on sixth key press (key code is O)
  1. composition end, the value in the field is テスト on 'Enter' key press

from formkit.

leewes avatar leewes commented on May 28, 2024

For reference, a true ime input on a simpler string input like aa -> ああ looks like this on the events fired:

image

from formkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.