mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
fixed: tab could not be entered using the keyboard
This commit is contained in:
@@ -3049,7 +3049,8 @@ var _CPCopyPlaceholder = '-';
|
||||
// Intercept problematic keys before the browser acts.
|
||||
_CPNativeInputField.addEventListener('keydown', function(e) {
|
||||
|
||||
if (e.key === 'Tab' || e.key === 'Enter' || (e.key === 'Backspace' && _CPNativeInputField.innerHTML === '')) {
|
||||
if (e.key === 'Tab' || e.key === 'Enter' || (e.key === 'Backspace' && _CPNativeInputField.innerHTML === ''))
|
||||
{
|
||||
// Prevent browser default action:
|
||||
// - 'Tab': Prevents browser focus navigation, allowing Cappuccino key bindings (like option-tab or tab) to work.
|
||||
// - 'Enter': Prevents inserting <div><br></div>.
|
||||
|
||||
@@ -1951,7 +1951,8 @@ CPTexturedBackgroundWindowMask
|
||||
return [[self firstResponder] keyUp:anEvent];
|
||||
|
||||
case CPKeyDown:
|
||||
if ([anEvent charactersIgnoringModifiers] === CPTabCharacter)
|
||||
if ([anEvent charactersIgnoringModifiers] === CPTabCharacter &&
|
||||
!([anEvent modifierFlags] & (CPAlternateKeyMask | CPCommandKeyMask)))
|
||||
{
|
||||
if ([anEvent modifierFlags] & CPShiftKeyMask)
|
||||
[self selectPreviousKeyView:self];
|
||||
|
||||
Reference in New Issue
Block a user