19 lines
424 B
JavaScript
19 lines
424 B
JavaScript
/**
|
|
* @internal
|
|
* Finds and swaps a provided key for it's right to left format.
|
|
*/ export const getRTLSafeKey = (key, dir)=>{
|
|
if (dir === 'rtl') {
|
|
switch(key){
|
|
case 'ArrowLeft':
|
|
{
|
|
return 'ArrowRight';
|
|
}
|
|
case 'ArrowRight':
|
|
{
|
|
return 'ArrowLeft';
|
|
}
|
|
}
|
|
}
|
|
return key;
|
|
};
|