Skip to content

Conversation

nicolas-lambert-tc
Copy link
Contributor

@nicolas-lambert-tc nicolas-lambert-tc commented Jun 5, 2025

Description

Bug:

Clicking outside of a text component (a search filter in the example below), didn't release the focus.
Screenshot_2025-06-05_14-21-39

Now the focus is stolen by the main.MouseArea component

Related PR

This is an other approach of the PR provided by @waaake: #2666
It avoid creating MouseArea on existing and future components.

Implementation Details

It uses the eventFilter to only catch the mousePress events and clear focus each time an item have a focus at this step.

/!\ Having a python condition on each event can be time consuming.
It uses the EventFilter and can have some performance cost, but because it directly filtered event by type() (not isinstance) , it should be imperceptible.

Copy link

codecov bot commented Jun 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.15%. Comparing base (d5007c6) to head (6e35205).
Report is 49 commits behind head on develop.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2740   +/-   ##
========================================
  Coverage    77.14%   77.15%           
========================================
  Files           41       41           
  Lines         6165     6167    +2     
========================================
+ Hits          4756     4758    +2     
  Misses        1409     1409           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nicolas-lambert-tc nicolas-lambert-tc self-assigned this Jun 5, 2025
@nicolas-lambert-tc nicolas-lambert-tc marked this pull request as ready for review June 5, 2025 12:28
@nicolas-lambert-tc nicolas-lambert-tc changed the title [ui] Fix: The focus on text components is now released on outside click [ui] [fix]: The focus on text components is now released on outside click Jun 5, 2025
@nicolas-lambert-tc nicolas-lambert-tc force-pushed the fix/focus-stealing branch 5 times, most recently from a0bd696 to feb8e0f Compare June 5, 2025 13:34
Copy link
Member

@fabiencastan fabiencastan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem on copy/paste

@fabiencastan fabiencastan marked this pull request as draft June 7, 2025 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants