Re: Only Text Input and Intention Events

Hey again,

On Fri, Nov 28, 2014 at 10:03 AM, Frederico Knabben <f.knabben@cksource.com>
wrote:

>  @Johannes, if I understood it well, so far the discussion is about the
> character insertions intention only. It simply assumes that the selection
> exists. Our goal is defining how the insertion should work for *any kind*
> of selection.
>
> What you're talking about is to have a consistent selection UI. I agree
> this is also very important and I assume this is a different part of the
> spec.
>

yes, maybe. After reading the selection APi I am somewhat unsure. Take the
following case:

<p>Hello <i>Austri|a</i></p> ( | = caret)

If the user hits the right-key and then enters a "!", where should that end?

<p>Hello <i>Austria</i>!|</p> or  <p>Hello <i>Austria!|</i></p> ?

And what is the intermediate step? To the user, these two situations will
look the same:

<p>Hello <i>Austria</i>|</p> and <p>Hello <i>Austria|</i></p>

so it seems it would be reasonable that they will behave the same as well.

As far as I can tell, the selection Api doesn't talk about changing the
selection when moving the caret. If it's not specified anywhere, and
browsers choose to implement it different, we won't be sure so we will need
to continue to interrupt each key stroke event to check whether the caret
may be at the border of an element before letting it do its default action.
Then it may be easier to use a hidden textarea for input instead of
cE=typing.


>
> @Ben, btw, the proposed minimal cE includes caret movement and selection
> as well, right? In that case, please be sure to open a dedicated section in
> the spec just for that.
>
> Thanks!
>
> --
> Frederico Knabben
> CKEditor Project Lead and CKSource Owner
> --
> CKSource - http://cksource.com
> --
> Follow us on: Twitter <http://twitter.com/ckeditor> | Facebook
> <http://www.facebook.com/ckeditor> | Google+
> <https://plus.google.com/107736718646302128806> | LinkedIn
> <http://www.linkedin.com/company/cksource>
>
> On Thursday, 27 November 2014 at 21:11, Johannes Wilm wrote:
>
>  Editor devs can listen for text insert event, and if text is about to be
> inserted in the wrong node they can move the selection to the right place
> then let the default behavior take place.
>
>
>
> This all makes me think that this mode is something that noone ever
> expects to be useful by itself, without any javascript to support it.
>
>
> Yes. My view is that this is a developer's API.
>
>
> ok, that a legitimate position. This should be very clear in instructions
> spec, etc. for any developer building on top of it: In order to achieve
> consistent behavior, also insert character events *HAVE TO* be interrupted
> and the selection potentially moved before the event default takes place.
>
>
>


-- 
Johannes Wilm
Fidus Writer
http://www.fiduswriter.org

Received on Thursday, 4 December 2014 19:42:40 UTC