mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 23:05:42 +00:00
Bug 1357206 part 5. When moving the cursor to the end of text on value set, reset the selection direction as well, per spec. r=ehsan
This commit is contained in:
parent
29d5ae0bfd
commit
c11223cba0
@ -2651,6 +2651,7 @@ nsTextEditorState::SetValue(const nsAString& aValue, uint32_t aFlags)
|
||||
if (aFlags & eSetValue_MoveCursorToEndIfValueChanged) {
|
||||
props.SetStart(newValue.Length());
|
||||
props.SetEnd(newValue.Length());
|
||||
props.SetDirection(nsITextControlFrame::eForward);
|
||||
} else {
|
||||
// Make sure our cached selection position is not outside the new value.
|
||||
props.SetStart(std::min(props.GetStart(), newValue.Length()));
|
||||
|
Loading…
Reference in New Issue
Block a user