Re: [w3c/editing] [beforeinput] InputType for MacOS Transpose (ctrl-t) (#148)

> OK, so for example the default behavior for `Transpose` is similar to `Paste`

> * **Bold**|*Italic* -> **BolId**|*talic* (Where *I* was moved into `<b>`)

> JS might want to detect `Transpose` and override it to

> * **Bold**|*Italic* -> **BolI***d*|*talic* (Swap character but keeps style)

That's possible. I was thinking of a case such as:

```
...<span data-element="101" data-length="3">pic|</span><span data-element="102" data-length="4">ture</span>...
```

The spans above are something used by the JS editor and what the meaning of ```data-element``` and ```data-length``` is only clear to the JS. The browser doesn't know what this is. So say the user now hits ctrl+t. The browser may think it can join the two spans or maybe move one extra letter into the first span without increasing the ```data-length``` attribute of one and increase the one of the other. So this will have to be handled by JS. But if the JS only receives a ```beforeinput replaceContent``` event which says that the user intents to do some complex changes to the two spans, it may be quite difficult for the JS to understand that this was really about transposing.

> OK, so how about:

> 1. `deleteByKill` (similar to cut)
> 2. `insertFromYank` (similar to paste)
> 3. `transpose`

That sounds good to me.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/148#issuecomment-242214322

Received on Wednesday, 24 August 2016 21:29:48 UTC