bem / bem/bem-components

modal_autoclosable: close on highlighting text

Open
#2,115 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
330
Forks
88
PR merge metrics
No merged PRs in 30d

Description

If you start highlight text and stopping the highlighting outside of elem `content` then in the` pointerclick` `event.target` will be the parent node of the `content` element, and as a result the modal closes.

[Here](https://github.com/rtemred/project-stub/blob/bug/modal_autoclosable/desktop.bundles/modal_autoclosable/modal_autoclosable.bemjson.js) can be repeated: hold down mouse button and with the mouse movement highlight the text in title or input/textarea from left to right and let go of the mouse button the mouse button outside the `content` element - modal closes.
In Firefox, it is not always possible to repeat with input and textarea, but with simple text regularly, in Chrome - without much difference.

Contributor guide

Open the contributing guide

Research direction

Start with desktop.bundles/modal_autoclosable/modal_autoclosable.bemjson.js and reproduce the issue by highlighting title or input/textarea text, then releasing outside the content element in Chrome and Firefox. Trace the pointerclick target when selection ends outside content; done means highlighting text and releasing outside content no longer closes the modal.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.