mirror of
https://github.com/google/blockly.git
synced 2026-01-11 10:57:07 +01:00
Listen to focus events on children and add a focused class in the dropdown (#2848)
This commit is contained in:
@@ -145,6 +145,15 @@ Blockly.DropDownDiv.createDom = function() {
|
||||
Blockly.DropDownDiv.DIV_.style.transition = 'transform ' +
|
||||
Blockly.DropDownDiv.ANIMATION_TIME + 's, ' +
|
||||
'opacity ' + Blockly.DropDownDiv.ANIMATION_TIME + 's';
|
||||
|
||||
// Handle focusin/out events to add a visual indicator when
|
||||
// a child is focused or blurred.
|
||||
div.addEventListener('focusin', function() {
|
||||
Blockly.utils.dom.addClass(div, 'focused');
|
||||
});
|
||||
div.addEventListener('focusout', function() {
|
||||
Blockly.utils.dom.removeClass(div, 'focused');
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user