-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Problem
- If the default value of the string argument is "A"
- Type "B" and press Enter, reset button shown
- Press reset, value fallback to default "A"
- Type "B" again, reset button not shown
Is this an expected behavior ?
I found that it's because the self._previous attribute is holding the previous input from user, but not fallback to default when reset pressed.
Lines 464 to 470 in 2dcdc17
| def onEditingFinished(self): | |
| current = self._read() | |
| if current != self._previous: | |
| self.changed.emit() | |
| self._previous = current | |
So it's actually :
| Steps | _previous |
|---|---|
| Default value of the string argument is "A" | _previous == "A" |
| Type "B" and press Enter, reset button shown | _previous == "B", thanks to String.onEditingFinished |
| Press reset, value fallback to default "A" | _previous == "B", because String.write triggered by reset did not update it |
| Type "B" again, reset button not shown | current == self._previous, changed signal not emit |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels