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

Superfluous space inserted when entering a ' #7191

Closed
rhaamo opened this issue Aug 18, 2018 · 18 comments
Closed

Superfluous space inserted when entering a ' #7191

rhaamo opened this issue Aug 18, 2018 · 18 comments
Labels
P2 S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-Upstream

Comments

@rhaamo
Copy link

rhaamo commented Aug 18, 2018

Description

When entering a ' there is a space inserted right before in the input prompt.

Steps to reproduce

  • In a chat
  • Type like that's
  • Expect to see that's
  • See that 's instead
    image

Version information

  • Platform: web (in-browser)
  • Browser: Firefox Nightly (63.0a1, no stable to test)
  • OS: Ubuntu
  • URL: my own deployment of riot, reproduced with v0.16.0 and v0.16.1-rc.1

Markdown enabled or no doesn't change anything.
My layout is "English (US, intl., with dead keys)"
I used the firefox Profile Manager to create a blank one, logged to my riot, still have the issue.

@lampholder
Copy link
Member

There are a couple of other dead keys related bugs:

My problem is I don't know enough about this keyboard layout to reproduce the problems.

So, to try and create the right test environment, here's what I'm doing:

  • On Ubuntu LTS 16.04
  • Terminal: $ sudo dpkg-reconfigure keyboard-configuration
  • Choose: Generic 105-key (Intl) P
  • Choose: English (US)
  • Choose: English (US) - English (US, international with dead keys)
  • Choose key to function as AltGr: The default for the keyboard layout
  • Choose compose key: No compose key
  • Choose contral+alt+backspace to terminate X server: No

Then:

  • Go to riot electron
  • Select composer
  • Type that's by pressing the keys: thatAltGr+'s
  • Pressing carriage return to submit the message to riot

When I do this, I see that's exactly as it's meant to be seen - no additional spaces.

So - what's different between my test setup and what you're doing? If you can highlight the differences then we can get a reproducable problem and figure out what needs doing for a fix :D

Thanks!

@lampholder lampholder added T-Defect P2 X-Cannot-Reproduce S-Minor Impairs non-critical functionality or suitable workarounds exist labels Aug 20, 2018
@rhaamo
Copy link
Author

rhaamo commented Aug 20, 2018

Everything is same here, I just don't use the electron but web app.

However I type my ' by pressing ' then space, using AltGr' it works, just not the other method.

Same issue with ` too.

@rien
Copy link

rien commented Sep 3, 2018

I am also having this issue. When trying to insert a ' or " using the ' + space method. This is how dead keys work.

Usually, the diacritic itself can be generated as an isolated character by pressing the dead key followed by space; so a plain grave accent can be typed by pressing ` and then Space. This legacy behavior is newly replaced with a more efficient one with respect to the use of combining diacritics following the Unicode Standard. The combining diacritic is then obtained with Space, while a spacing form of the diacritic is inserted with No-Break Space (typically ⇧ Shift+Space or AltGr+Space).

@turt2live
Copy link
Member

@rhaamo have you seen this on recent versions of Riot (0.17 or higher)? I'm a little concerned it is a duplicate of #7124 however #7124 says that it doesn't happen on Firefox.

@turt2live turt2live added the X-Needs-Info This issue is blocked awaiting information from the reporter label Oct 31, 2018
@rhaamo
Copy link
Author

rhaamo commented Nov 5, 2018

I definitely had this issue on Firefox and was the case with 0.17.0 too.

However in the mean time I upgraded from Ubuntu LTS to the latest "stable" and I can't reproduce the issue (still sometimes the '" etc. acts weirdly).

So... I don't really know, that issue have been affecting a bunch of people and some works where some other using the same setup doesn't.

Perhaps something on gnome/gtk input handling side was broken and updating fixed it.

I might get back to LTS because the "stable" is causing me issues (unrelated to riot) so I will look if it's again an issue after reinstalling.

@turt2live
Copy link
Member

I'll give it a try on 18.04 and see what happens. My testing with 18.10 seems to show it is fixed, so it might indeed be a package problem.

@turt2live
Copy link
Member

I think this might be an 18.04 issue at the very least: I can't get the dead keys to work in any application. In 18.10 everything is fine, but in 18.04 is definitely broken. I tried with US International (with dead keys) and Spanish (with dead tilde).

@turt2live turt2live removed their assignment Nov 5, 2018
@turt2live
Copy link
Member

This is not an upstream issue as far as I can tell. I finally got a reproducible test case, and it is specific to Riot.

@turt2live turt2live added type:composer and removed X-Cannot-Reproduce X-Needs-Info This issue is blocked awaiting information from the reporter Z-Upstream labels Nov 5, 2018
@turt2live turt2live self-assigned this Nov 5, 2018
@turt2live
Copy link
Member

I'm pretty sure this is an upstream Firefox issue. Firefox is sending two keyDown events for space, leading to Riot doing the right thing and inserting two spaces. I've reported it here and I guess we'll see where it goes: https://bugzilla.mozilla.org/show_bug.cgi?id=1505147

I managed to create a minimal test case to prove it is not a Riot issue with this code pen: https://codepen.io/anon/pen/YRyNpv

@turt2live turt2live removed their assignment Nov 6, 2018
@rhaamo
Copy link
Author

rhaamo commented Nov 6, 2018

Thanks for finding this !

I tried your codepen but can't reproduce, but I'm using Firefox Nightly (65.0a1 (2018-10-30) currently) on ubuntu 18.10 too.

That's a weird one, let's see how the firefox side of the bug will goes.

@turt2live
Copy link
Member

As of a few minutes ago, the Firefox bug was classified as fixed for Firefox 65. Would be good to see if the issue gets fixed for people when the patch lands somewhere usable for testing.

@jryans
Copy link
Collaborator

jryans commented Dec 12, 2018

The Firefox fix here should be present in both Nightly and Beta builds, if someone affected would like to give those a try to confirm the fix. It hasn't reached Release channel yet.

@rhaamo
Copy link
Author

rhaamo commented Dec 15, 2018

I've finally reinstalled ubuntu lts after too many issues with my update to the latest and I can try again.

Updated riot (web) to 0.17.8 and firefox is nightly up to date.

And I still have the superfluous spaces in riot :(

@jryans
Copy link
Collaborator

jryans commented Dec 19, 2018

I have just compared Firefox 64 vs. 66 on Ubuntu 18.04.1.

It appears there are multiple Firefox bugs in play here:

  • @turt2live reported the case of ''Space which I have verified is indeed fixed in Firefox 65+
  • I have reported the case of 'Space which is currently waiting on Firefox for triage

@rhaamo
Copy link
Author

rhaamo commented Dec 29, 2018

from the reply in the new firefox bug issue, it looks like it's the correct behaviour and not a bug (in firefox).

so it would be a bug in the input lib-thing riot-web is using ?

@jryans
Copy link
Collaborator

jryans commented Dec 31, 2018

For the 'Space case, it does seem like Firefox is following the keyboard events spec more closely than Chrome, so it's unlikely that Firefox will make a change.

After more investigation, the Slate input library we use in Riot does not have this issue by itself. Using the Slate example page, 'Space works as expected (a single ' character is added).

The problem is introduced by an onKeyDown handler in the Riot React SDK. This exists to mark each word you type as separate chunks for undo / redo.

One way to keep this undo feature while also avoiding the extra space problem here would be to instead use the keypress event in place of keydown. However... the Slate library doesn't currently let you use onKeyPress handlers. 😭 So, for now I am trying to investigate if Slate would accept an addition of onKeyPress handlers.

There may also be some other way to rewrite what Riot's doing with the space character that also avoids this issue, so we'll keep looking at other possibilities as well.

Thanks for your patience. I can imagine this must be frustrating!

@t3chguy
Copy link
Member

t3chguy commented Mar 24, 2020

Is this still an issue for you in the new composer?

@t3chguy
Copy link
Member

t3chguy commented Apr 14, 2020

Assuming no

@t3chguy t3chguy closed this as completed Apr 14, 2020
su-ex added a commit to SchildiChat/element-web that referenced this issue Dec 7, 2021
* Add unread indicator to the timelineCard header icon ([\element-hq#7156](matrix-org/matrix-react-sdk#7156)). Fixes element-hq#19635.
* Only show core navigation elements (call/chat/notification/info) when a widget is maximised ([\element-hq#7114](matrix-org/matrix-react-sdk#7114)). Fixes element-hq#19632.
* Improve ThreadPanel ctx menu accessibility ([\element-hq#7217](matrix-org/matrix-react-sdk#7217)). Fixes element-hq#19885.
* Allow filtering room list during treeview navigation ([\element-hq#7219](matrix-org/matrix-react-sdk#7219)). Fixes element-hq#14702.
* Add right panel chat timeline ([\element-hq#7112](matrix-org/matrix-react-sdk#7112)). Fixes element-hq#19633.
* Hide server options hint when disable_custom_urls is true ([\element-hq#7215](matrix-org/matrix-react-sdk#7215)). Fixes element-hq#19919.
* Improve right panel resize handle usability ([\element-hq#7204](matrix-org/matrix-react-sdk#7204)). Fixes element-hq#15145. Contributed by @weeman1337.
* Spaces quick settings ([\element-hq#7196](matrix-org/matrix-react-sdk#7196)).
* Maximised widgets always force a call to be shown in PIP mode ([\element-hq#7163](matrix-org/matrix-react-sdk#7163)). Fixes element-hq#19637.
* Group Labs flags ([\#7190](matrix-org/matrix-react-sdk#7190)).
* Show room context details in forward dialog ([\element-hq#7162](matrix-org/matrix-react-sdk#7162)). Fixes element-hq#19793.
* Remove chevrons from RoomSummaryCard_Button ([\element-hq#7137](matrix-org/matrix-react-sdk#7137)). Fixes element-hq#19644.
* Disable op/deop commands where user has no permissions ([\element-hq#7161](matrix-org/matrix-react-sdk#7161)). Fixes element-hq#15390.
* Add option to change the size of images/videos in the timeline ([\element-hq#7017](matrix-org/matrix-react-sdk#7017)). Fixes element-hq/element-meta#49 element-hq#1520 and element-hq#19498.
* Fix left panel glow in Safari ([\element-hq#7236](matrix-org/matrix-react-sdk#7236)). Fixes element-hq#19863.
* Fix newline on edit messages with quotes ([\element-hq#7227](matrix-org/matrix-react-sdk#7227)). Fixes element-hq#12535. Contributed by @renancleyson-dev.
* Guard against null refs in findSiblingElement ([\#7228](matrix-org/matrix-react-sdk#7228)).
* Tweak bottom of space panel buttons in expanded state ([\element-hq#7213](matrix-org/matrix-react-sdk#7213)). Fixes element-hq#19921.
* Fix multiline paragraph rendering as single line ([\element-hq#7210](matrix-org/matrix-react-sdk#7210)). Fixes element-hq#8786. Contributed by @renancleyson-dev.
* Improve room list message previews ([\element-hq#7224](matrix-org/matrix-react-sdk#7224)). Fixes element-hq#17101 and element-hq#16169.
* Fix EmojiPicker lazy loaded rendering bug ([\element-hq#7225](matrix-org/matrix-react-sdk#7225)). Fixes element-hq#15341.
* Prevent default avatar in UserInfo having pointer cursor ([\element-hq#7218](matrix-org/matrix-react-sdk#7218)). Fixes element-hq#13872.
* Prevent duplicate avatars in Event List Summaries ([\element-hq#7222](matrix-org/matrix-react-sdk#7222)). Fixes element-hq#17706.
* Respect the home page as a context for the Home space ([\element-hq#7216](matrix-org/matrix-react-sdk#7216)). Fixes element-hq#19554.
* Fix RoomUpgradeWarningBar exploding ([\element-hq#7214](matrix-org/matrix-react-sdk#7214)). Fixes element-hq#19920.
* Polish threads misalignments and UI diversion ([\element-hq#7209](matrix-org/matrix-react-sdk#7209)). Fixes element-hq#19772, element-hq#19710 element-hq#19629 and element-hq#19711.
* Fix Manage Restricted Join Rule Dialog for Spaces ([\element-hq#7208](matrix-org/matrix-react-sdk#7208)). Fixes element-hq#19610.
* Fix wrongly showing unpin in pinned messages tile with no perms ([\element-hq#7197](matrix-org/matrix-react-sdk#7197)). Fixes element-hq#19886.
* Make image size constrained by height when using the ImageSize.Large option ([\element-hq#7171](matrix-org/matrix-react-sdk#7171)). Fixes element-hq#19788.
* Prevent programmatic scrolling within truncated room sublists ([\element-hq#7191](matrix-org/matrix-react-sdk#7191)).
* Remove leading slash from /addwidget Jitsi confs ([\element-hq#7175](matrix-org/matrix-react-sdk#7175)). Fixes element-hq#19839. Contributed by @AndrewFerr.
* Fix automatic composer focus, regressed by threads work ([\element-hq#7167](matrix-org/matrix-react-sdk#7167)). Fixes element-hq#19479.
* Show space members when not invited even if summary didn't fail ([\element-hq#7153](matrix-org/matrix-react-sdk#7153)). Fixes element-hq#19781.
* Prevent custom power levels from breaking roles & permissions tab ([\element-hq#7160](matrix-org/matrix-react-sdk#7160)). Fixes element-hq#19812.
* Room Context Menu should respond to tag changes ([\element-hq#7154](matrix-org/matrix-react-sdk#7154)). Fixes element-hq#19776.
* Fix an edge case when trying to join an upgraded room ([\element-hq#7159](matrix-org/matrix-react-sdk#7159)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-Upstream
Projects
None yet
Development

No branches or pull requests

6 participants