Skip to content

input / textarea - mouse interaction doesn't work #10083

Description

@yoava333

clicking on a specific position doesn't move the cursor to that specific position.
selection with the mouse doesn't work

Activity

  1. jdm commented on Mar 18, 2016

    @jdm
    Member

    Pretty sure the reason I didn't implement this original was that figuring out the correspondence between click position and text character index is complicated for non-monospace fonts.

  2. pcwalton commented on Mar 19, 2016

    @pcwalton
    Contributor

    @jdm The text run glyph stores should have enough info to do it.

  3. fiji-flo commented on Sep 25, 2016

    @fiji-flo
    Contributor

    I started working on this (fiji-flo@6e03787).

    I got a first working version to see if I'm on the right path. I guess the only proper way here is to use a new RPC to talk to layout. I'll continue to work on this and post updates.

    Here is how it looks like:
    https://static.fiji-flo.de/servo-inputelement.webm

  4. jdm commented on Sep 25, 2016

    @jdm
    Member

    Great work! One other case to test is whether that query works correctly after scrolling the page away from the origin, both for a text input that was originally in view and for one that scrolls into view.

  5. fiji-flo commented on Sep 26, 2016

    @fiji-flo
    Contributor

    Thanks for the first input. Positioning after scrolling seems to be working like it should. I might run into problems when the input is in a different stacking context. But I'll figure it out.

    current issues:

    • performace
    • revisit/check flow
    • track and apply transforms
    • stacking context
  6. fiji-flo commented on Oct 17, 2016

    @fiji-flo
    Contributor

    Small status update. I found some time yesterday and continued working on this. I changed a lot and it should work with transforms and stacking contexts. I took care of some performance issues and found some bugs.

    Here's the current diff:
    master...fiji-flo:text-input-select

    And here how it looks:
    https://static.fiji-flo.de/servo-inputelement-stacking.webm

    Things to clean up before I'll create a PR:

    • entering space triggers a mouse click (work around or fix)
    • refactor duplicated code: unify text_index and hit_test

    This will only take care of input elements. Afterwards, I'll start working on textarea and general text selection.

  7. added
    C-assigned
    on Oct 17, 2016
  8. fiji-flo commented on Nov 7, 2016

    @fiji-flo
    Contributor

    Still no open PR sorry for that. I didn't have to much time and found an issue with horizontal scrolling. I worked around the space bar issue.
    master...fiji-flo:text-input-select

    TODO:

    • refactor duplicated code: unify text_index and hit_test (my fist naive approach to this didn't work out)
    • write reftests for this
  9. fiji-flo commented on Nov 20, 2016

    @fiji-flo
    Contributor

    I refactored the duplicated code and adopted to the latest changes in display_list.

    Mouse placement works now for input elements. I made a pull request out of this.
    @jdm Can you think of a way to test this? Reftests don't really cover external input.

    I will continue to work on:

    • positioning in textarea elements via mouse
    • text selection in input/textarea elements via mouse
  10. jdm commented on Nov 20, 2016

    @jdm
    Member

    Until we have the webdriver test harness working, we can't write tests that rely on user input.

  11. added a commit that references this issue on Jan 11, 2017
  12. fiji-flo commented on Jan 12, 2017

    @fiji-flo
    Contributor

    @jdm can you reopen that ticket?

    Still missing:

    • position cursor in textareas
    • selecting text input / textarea

    I already started working on theses.

  13. nox commented on Oct 1, 2017

    @nox
    Contributor

    Was this done in the end?

  14. removed
    C-assigned
    on May 8, 2020
  15. added
    C-is-this-done
    on Jul 1, 2020
  16. added this to the 1.0 blockers milestone on Dec 18, 2025
  17. added a commit that references this issue on Jan 14, 2026
    d5dcdd6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-inputA-layout/queryC-is-this-done

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions