Closed IVLIVS-III closed 1 year ago
Hi @IVLIVS-III , thx for raising it, can u attach the proposal video?
@TinoGuo do you mean a screen-recording of how it looks when both Cursor
and HintText
are provided?
@IVLIVS-III yes, from what i check from the code, CWIIW it seems append the cursor after the hint text
@TinoGuo I can provide a screen recording in a couple of hours, currently I'm not in my dev environment.
But with TextDirection
set to TextDirection.ltr
(default) the Cursor
will be displayed in front of (i.e. to the left of) HintText
since the positive Offset
of half the HintText
width is subtracted in lines 31 and 32 of lib/src/cursor/cursor_painter.dart
.
Edit: if this way of applying the Offset
seems to you to be "backwards" I can gladly change that as well to then adding a negative Offset
@TinoGuo here is a screen recording. I hope it shows everything you would like to see: https://user-images.githubusercontent.com/48645716/189208615-708d2e21-cadb-4456-8952-af77b449cf01.mov
yeah, it looks awesome, I will review it soon. thx again
pipeline should be successful now, right?
actually not work unless rebase it. but the root cause is not from PR, i approved it and merge it.
Since the introduction of a
Cursor
in version 3.2.0, if enabled saidCursor
would override anyHintText
due to them being displayed in the same location on screen (both centered in the box). This PR addresses that issue and proposes a solution that can display both aCursor
andHintText
at the same time.premises
Cursor
andHintText
should coexist and be displayed at the same timeHintText
should not have a different position with/withoutCursor
HintText
should be displayed in the center of the boxCursor
should not be displayed in the center of the box if aHintText
is also presentCursor
should be displayed in front ofHintText
or behindCursor
typically is (on input fields with left-justified text) after already typed charactersHintText
typically is displayed only when no characters have been entered yetCursor
should be displayed in front of theHintText
at least withTextDirection.ltr
proposed fix
Offset offset
with a default value ofOffset.zero
TextDirection.ltr
theCursor
is drawn to the left ofHintText
, onTextDirection.rtl
it is drawn to the rightside effects
TextDirection
parameter was added