mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 14:39:06 +00:00
@@ -132,9 +132,19 @@ export default function EventBlock(props: EventBlockProps) {
|
|||||||
|
|
||||||
const binderColours = colour && getAccessibleColour(colour);
|
const binderColours = colour && getAccessibleColour(colour);
|
||||||
|
|
||||||
|
// move focus to element if necessary
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (hasCursor) {
|
if (!hasCursor || handleRef?.current == null) {
|
||||||
handleRef?.current?.focus();
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const elementInFocus = document.activeElement;
|
||||||
|
// we know the block is the grandparent of our binder
|
||||||
|
const blockElement = handleRef.current.closest('#event-block');
|
||||||
|
|
||||||
|
// we only move focus if the block doesnt already contain focus
|
||||||
|
if (blockElement && !blockElement.contains(elementInFocus)) {
|
||||||
|
handleRef.current.focus();
|
||||||
}
|
}
|
||||||
}, [hasCursor]);
|
}, [hasCursor]);
|
||||||
|
|
||||||
@@ -184,6 +194,7 @@ export default function EventBlock(props: EventBlockProps) {
|
|||||||
style={dragStyle}
|
style={dragStyle}
|
||||||
onClick={handleFocusClick}
|
onClick={handleFocusClick}
|
||||||
onContextMenu={onContextMenu}
|
onContextMenu={onContextMenu}
|
||||||
|
id='event-block'
|
||||||
>
|
>
|
||||||
<div className={style.binder} style={{ ...binderColours }} tabIndex={-1}>
|
<div className={style.binder} style={{ ...binderColours }} tabIndex={-1}>
|
||||||
<span className={style.drag} ref={handleRef} {...dragAttributes} {...dragListeners}>
|
<span className={style.drag} ref={handleRef} {...dragAttributes} {...dragListeners}>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { TranslationObject } from './en';
|
|||||||
export const langIt: TranslationObject = {
|
export const langIt: TranslationObject = {
|
||||||
'common.end_time': 'Ora di Fine',
|
'common.end_time': 'Ora di Fine',
|
||||||
'common.expected_finish': 'Fine Prevista',
|
'common.expected_finish': 'Fine Prevista',
|
||||||
|
'common.minutes': 'min',
|
||||||
'common.now': 'Adesso',
|
'common.now': 'Adesso',
|
||||||
'common.next': 'Prossimo',
|
'common.next': 'Prossimo',
|
||||||
'common.public_message': 'Messaggio pubblico',
|
'common.public_message': 'Messaggio pubblico',
|
||||||
|
|||||||
Reference in New Issue
Block a user