Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Selecting initial characters and pressing . or invalid character for the filter inserts wrong charaters at FilteredLineEdit and FilteredTextEdit #14

Open
3 tasks
acgc99 opened this issue Aug 4, 2023 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@acgc99
Copy link
Owner

acgc99 commented Aug 4, 2023

Bugs at FilteredLineEdit and FilteredTextEdit:

  • In +0f mode. Example onFilteredLineEdit: 42, select 4, press ., makes text = .2.
  • In f mode. Example onFilteredLineEdit: 42, select 4, press ., makes text = 222.
  • In +0f or f mode. Example onFilteredLineEdit: 42, select 4, press invalid character by the filter, makes text = 222.

The desired behaviour would be:

  • If .: replace selected text by 0..
  • If invalid character by filter: delete selected text.
  • Check also caret position if you are facing this issue.

I think this is hard (or impossible) to solve because:

  • When _on_text_changed is called, the selection is already lost, so it cannot be known what was selected.
  • If you try to compare old_text and new_text and selection only applies to one character, you cannot distinguish between that selection or a simple deletion of one character.
  • get_selection_from_column and get_selection_to_column return -1 (error), so they cannot be used either.

If this is not solved, the user can set FilteredLineEdit.selecting_enabled = false and FilteredTextEdit.selecting_enabled = false. This have also disadvantages, you can't select text and copy it, you would have to implement some button.

@acgc99 acgc99 added bug Something isn't working help wanted Extra attention is needed priority: low wontfix This will not be worked on and removed priority: low wontfix This will not be worked on labels Aug 4, 2023
@acgc99 acgc99 added this to the vX milestone Aug 4, 2023
@acgc99 acgc99 changed the title Selecting initial characters and pressing . or invalid character for the filter inserts wrong charaters Selecting initial characters and pressing . or invalid character for the filter inserts wrong charaters at FilteredLineEdit and FilteredTextEdit Aug 5, 2023
@acgc99 acgc99 removed this from the vX milestone Oct 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant