Bug 36388 - Mouse operation does not work in draggable fields in authority editor (with Firefox)
Summary: Mouse operation does not work in draggable fields in authority editor (with F...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Authority data support (show other bugs)
Version: Main
Hardware: All All
: P3 minor (vote)
Assignee: Janusz Kaczmarek
QA Contact: Victor Grousset/tuxayo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-21 14:43 UTC by Janusz Kaczmarek
Modified: 2024-05-28 22:01 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.06


Attachments
Bug 36388: Mouse operation does not work in draggable fields in authority editor (3.68 KB, patch)
2024-03-21 15:34 UTC, Janusz Kaczmarek
Details | Diff | Splinter Review
Bug 36388: Mouse operation does not work in draggable fields in authority editor (3.73 KB, patch)
2024-03-21 19:51 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 36388: Mouse operation does not work in draggable fields in authority editor (3.79 KB, patch)
2024-04-30 04:05 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 36388: Mouse operation does not work in draggable fields in authority editor (5.12 KB, patch)
2024-04-30 11:39 UTC, Janusz Kaczmarek
Details | Diff | Splinter Review
Bug 36388: Mouse operation does not work in draggable fields in authority editor (5.12 KB, patch)
2024-04-30 11:42 UTC, Janusz Kaczmarek
Details | Diff | Splinter Review
Bug 36388: Mouse operation does not work in draggable fields in authority editor (5.18 KB, patch)
2024-05-03 10:26 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 36388: Mouse operation does not work in draggable fields in authority editor (5.18 KB, patch)
2024-05-09 22:06 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Janusz Kaczmarek 2024-03-21 14:43:21 UTC
When using the authority editor in Firefox, it is not possible to set the cursor or select text from the text field. 

At some point (after bug 34114 ?), there was a similar problem with mouse operations (set cursor, select etc.) in draggable fields in the biblio editor.  This was fixed by bug 35425.

NB the problem only shows up in Firefox, Chrome seems to work correctly.

To reproduce: start editing an existing authority record and try to put the cursor with the mouse in the middle of the content of any subfield or to select text with the mouse.
Comment 1 Janusz Kaczmarek 2024-03-21 15:34:20 UTC
Created attachment 163633 [details] [review]
Bug 36388: Mouse operation does not work in draggable fields in authority editor

When using the authority editor in Firefox, it is not possible to set
the cursor or select text from the text field.

This patch mimics the corrections made in bug 35425 for biblio editor.

Test plan:
==========
1. Start editing an existing authority record and try to put the cursor
   with the mouse in the middle of the content of any subfield or to
   select text with the mouse. It should not be possilbe.
2. Apply the patch (reload plack etc.).
3. Repeat p. 1 - everything should work as expected.
Comment 2 Lucas Gass 2024-03-21 19:51:17 UTC
Created attachment 163652 [details] [review]
Bug 36388: Mouse operation does not work in draggable fields in authority editor

When using the authority editor in Firefox, it is not possible to set
the cursor or select text from the text field.

This patch mimics the corrections made in bug 35425 for biblio editor.

Test plan:
==========
1. Start editing an existing authority record and try to put the cursor
   with the mouse in the middle of the content of any subfield or to
   select text with the mouse. It should not be possilbe.
2. Apply the patch (reload plack etc.).
3. Repeat p. 1 - everything should work as expected.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 3 Andrii Nugged 2024-03-22 02:15:33 UTC
Note: there was related issue: Bug 35383, solved differently, but I think we should analyze how to make "common", unified solution with same coding style
Comment 4 Esther Melander 2024-03-22 16:07:16 UTC
Also referencing Bug 36324, which I should have referenced was happening in a Chrome based browser.
Comment 5 Victor Grousset/tuxayo 2024-04-30 04:05:41 UTC
Created attachment 165825 [details] [review]
Bug 36388: Mouse operation does not work in draggable fields in authority editor

When using the authority editor in Firefox, it is not possible to set
the cursor or select text from the text field.

This patch mimics the corrections made in bug 35425 for biblio editor.

Test plan:
==========
1. Start editing an existing authority record and try to put the cursor
   with the mouse in the middle of the content of any subfield or to
   select text with the mouse. It should not be possilbe.
2. Apply the patch (reload plack etc.).
3. Repeat p. 1 - everything should work as expected.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 6 Victor Grousset/tuxayo 2024-04-30 05:05:16 UTC
The first attempt, the selected text in a subfield has a 1 second latency before highlighting text selected. (auth and biblios so it's from Bug 35383)

That's weird but not blocking.

(In reply to Andrii Nugged from comment #3)
> Note: there was related issue: Bug 35383, solved differently, but I think we
> should analyze how to make "common", unified solution with same coding style

Good point, I had issues testing and when it worked, I forgot about this and attached a second signoff (it's just a 2nd signoff, it's valid).
Back to this remark, for QA that's an issue because copying the change of bug 35425 is introducing duplication.

initializeSortable() is totally duplicated and even the calls to it would benefit from being in the same place for biblios and auths to be sure that if those for on editor are changed, the others are.

cataloging.js is included in addbiblio.tt and authorities.tt so unless something unexpected, moving the js change from addbiblio.tt and authorities.tt to cataloging.js should work.

And then it's possible to solve the duplication of when cloning a field in cataloging.js.
Because that part has the same code as initializeSortable()

I don't know if it was noticed in bug 35425 that duplication was introduced, but it was it might have been ok to not bother. But now it's a third time duplication, see rule of three: https://en.wikipedia.org/wiki/Rule_of_three_(computer_programming)
Comment 7 Janusz Kaczmarek 2024-04-30 11:37:49 UTC
(In reply to Victor Grousset/tuxayo from comment #6)
> And then it's possible to solve the duplication of when cloning a field in
> cataloging.js.
> Because that part has the same code as initializeSortable()

Victor, thank you for your remark.  I'm submitting a corrected version following your suggestion--for your evaluation.

The strange thing is, however, that we do not notice any latency when highlighting strings after a click...
Comment 8 Janusz Kaczmarek 2024-04-30 11:39:10 UTC
Created attachment 165851 [details] [review]
Bug 36388: Mouse operation does not work in draggable fields in authority editor

When using the authority editor in Firefox, it is not possible to set
the cursor or select text from the text field.

This patch mimics the corrections made in bug 35425 for biblio editor.

Test plan:
==========
1. Start editing an existing authority record and try to put the cursor
   with the mouse in the middle of the content of any subfield or to
   select text with the mouse. It should not be possilbe.
2. Apply the patch (reload plack etc.).
3. Repeat p. 1 - everything should work as expected.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 9 Janusz Kaczmarek 2024-04-30 11:42:20 UTC
Created attachment 165852 [details] [review]
Bug 36388: Mouse operation does not work in draggable fields in authority editor

When using the authority editor in Firefox, it is not possible to set
the cursor or select text from the text field.

This patch mimics the corrections made in bug 35425 for biblio editor.

Test plan:
==========
1. Start editing an existing authority record and try to put the cursor
   with the mouse in the middle of the content of any subfield or to
   select text with the mouse. It should not be possilbe.
2. Apply the patch (reload plack etc.).
3. Repeat p. 1 - everything should work as expected.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 10 Pedro Amorim 2024-05-03 10:26:45 UTC
Created attachment 166105 [details] [review]
Bug 36388: Mouse operation does not work in draggable fields in authority editor

When using the authority editor in Firefox, it is not possible to set
the cursor or select text from the text field.

This patch mimics the corrections made in bug 35425 for biblio editor.

Test plan:
==========
1. Start editing an existing authority record and try to put the cursor
   with the mouse in the middle of the content of any subfield or to
   select text with the mouse. It should not be possilbe.
2. Apply the patch (reload plack etc.).
3. Repeat p. 1 - everything should work as expected.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 11 Victor Grousset/tuxayo 2024-05-09 22:06:29 UTC
Created attachment 166478 [details] [review]
Bug 36388: Mouse operation does not work in draggable fields in authority editor

When using the authority editor in Firefox, it is not possible to set
the cursor or select text from the text field.

This patch mimics the corrections made in bug 35425 for biblio editor.

Test plan:
==========
1. Start editing an existing authority record and try to put the cursor
   with the mouse in the middle of the content of any subfield or to
   select text with the mouse. It should not be possilbe.
2. Apply the patch (reload plack etc.).
3. Repeat p. 1 - everything should work as expected.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 12 Victor Grousset/tuxayo 2024-05-09 22:07:13 UTC
> The strange thing is, however, that we do not notice any latency when highlighting strings after a click...

Only happens in 0XX fields.


Anyway.
Works, makes sense, QA script happy, code looks good, passing QA :)
Comment 13 Katrin Fischer 2024-05-10 12:13:06 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 14 Fridolin Somers 2024-05-24 15:30:41 UTC
Pushed to 23.11.x for 23.11.06
Comment 15 Lucas Gass 2024-05-28 22:01:09 UTC
Not needed in 23.05.x, no backport.