responsively-app icon indicating copy to clipboard operation
responsively-app copied to clipboard

Checkboxes cannot be checked by clicking on their label

Open jeyj0 opened this issue 4 years ago • 9 comments

When opening a site with a checkbox that has a corresponding label tag, clicking on the label (not the checkbox) checks and instantly unchecks the checkbox.

Expected behavior: when clicking on the label, the checkbox should only switch state once.

Minimal HTML to reproduce (both don't work):

<html>
<body>
<input id="check" type="checkbox">
<label for="check">Click me</label>
<label>
<input type="checkbox">
Click me too
</label>
</body>
</html>

jeyj0 avatar Jun 26 '20 18:06 jeyj0

@jeyj0 can you please share the responsivelyapp version? the checkbox checks and unchecks as expected. I am using 0.4.0

esprush avatar Jun 27 '20 04:06 esprush

I'm using 0.4.0, but I'm on NixOS - so that might be creating the issue. I'll try to reproduce on another machine when I get the time, but for now here's the nix expression I used to get responsively packaged on NixOS:

{ stdenv, fetchurl, appimageTools }:

let
  inherit (appimageTools) wrapType2;

  name = "responsively";
  src = fetchurl {
    url = "https://github.com/manojVivek/responsively-app/releases/download/v0.4.0/ResponsivelyApp-0.4.0.AppImage";
    sha256 = "0n17hipkys3zhihpspll2bx40338fikq428i50bp5zip9gd1i1r7";
  };
in
wrapType2 {
  inherit name src;

  extraInstallCommands = ''
    mkdir -p $out/share/applications
    echo "[Desktop Entry]
Encoding=UTF-8
Type=Application
Exec=responsively
Name=Responsively App
Version=0.4.0" > $out/share/applications/responsively.desktop
  '';
}

jeyj0 avatar Jun 27 '20 13:06 jeyj0

Codesandbox for reproduction https://codesandbox.io/s/cranky-feynman-l5l48?file=/index.html

Open https://xr5xg.csb.app/ on responsively-app

The first checkbox works. The second one doesn't.

Tested on

Version: 0.7.0
Electron: 8.3.0
Chrome: 80.0.3987.165
Node.js: 12.13.0
V8: 8.0.426.27-electron.0
OS: Linux x64 4.15.0-107-generic

atilacamurca avatar Jul 15 '20 19:07 atilacamurca

Version: 0.7.0 Electron: 8.3.0 Chrome: 80.0.3987.165 Node.js: 12.13.0 V8: 8.0.426.27-electron.0 OS: Windows_NT x64 10.0.18362

The issue I noticed is related to this "checkbox inside a label" pattern (to get it checked when clicking on checkbox, label or the space in between)

<label>
    <input type="checkbox">
    Click me too
</label>

But what I saw is that the check/uncheck action is not syncing correctly. I mean, when you click the checkbox on a device it works just fine but does not sync well with other devices. I think this is because the sync algorithm is sending two separated click events (one for the label and one for the input), so the result state of the checkbox is the same as the initial one. You can even sometimes see how the checkbox changes and then it changes again (happens fast), proving that there are two actions applied (in the gif below you can see it clearly near the end)

You can see it better here: chkbx

When you click in the checkbox it works fine because it is sending just one click event

jjavierdguezas avatar Jul 16 '20 08:07 jjavierdguezas

Can i work on this?

Arkadipta-Chatterjee avatar Aug 22 '21 15:08 Arkadipta-Chatterjee

Hello, May I know if anyone is working on this issue? If not I would like to work on this as this seems to be a good issue to start with this project as I am new here. I would be glad if I get assigned to this issue.

Thank you

GunjanRajTiwari avatar Sep 01 '21 02:09 GunjanRajTiwari

Hello, May I know if anyone is working on this issue? If not I would like to work on this as this seems to be a good issue to start with this project as I am new here. I would be glad if I get assigned to this issue.

Thank you

Hi @GunjanRajTiwari thanks you for trying this, I am assigning this issue to you

jjavierdguezas avatar Sep 01 '21 09:09 jjavierdguezas

Can i work on this?

Sorry @Arkadipta-Chatterjee I didn't see your request 😓, I already assigned this to @GunjanRajTiwari, please try another one 🙏🏻

jjavierdguezas avatar Sep 01 '21 10:09 jjavierdguezas

Thank you for assigning me.

To keep track of the progress.

  • [x] Read all the guidelines
  • [x] Setup the Project
  • [ ] Find the root cause of the issue
  • [ ] Solve the issue
  • [ ] Make a pull request

As I am quite new it may take some time and I am thankful for this opportunity.

GunjanRajTiwari avatar Sep 01 '21 11:09 GunjanRajTiwari