mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-21 01:40:41 +00:00
Overwrite selected tokens by typing support.
If tokens are selected in `CPTokenField` and new text is entered, the selected tokens are overwritten by the newly entered text.
This commit is contained in:
@@ -699,6 +699,14 @@ var CPScrollDestinationNone = 0,
|
||||
}
|
||||
else
|
||||
{
|
||||
// If you type something while tokens are selected, overwrite them.
|
||||
if (_selectedRange.length)
|
||||
{
|
||||
[self _removeSelectedTokens:self];
|
||||
// Make sure the editor is placed so it can capture the characters we're overwriting with.
|
||||
[self layoutSubviews];
|
||||
}
|
||||
|
||||
// If we didn't handle it, allow _propagateCurrentDOMEvent the input field to receive
|
||||
// the new character.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user