Skip to content

Instantly share code, notes, and snippets.

@JavierSolis
Created September 25, 2024 20:05
Show Gist options
  • Save JavierSolis/91e669a3d0f04d0dc9fdbba342b902fa to your computer and use it in GitHub Desktop.
Save JavierSolis/91e669a3d0f04d0dc9fdbba342b902fa to your computer and use it in GitHub Desktop.
Bumeran Hack Add Skills
// Selecciona el elemento de entrada por su ID
const inputElement = document.querySelector('#react-select-113-input');
const skills = [
// Lenguajes
"Kotlin", "Java", "Swift", "Objective-C", "JavaScript",
// Frameworks y Librerías
"Android SDK", "Jetpack Compose", "Picasso", "Glide", "Lottie",
"Hilt", "Koin", "Gson", "JSON", "Moshi",
// Plataformas y Herramientas
"Android Studio", "Xcode", "Custom View", "XML", "Firebase",
// Arquitecturas y Componentes
"MVP", "MVVM", "SQLite", "Room", "DataBinding",
"LifeCycle", "LiveData", "ViewModel", "Google Maps", "Restful",
// Bases de Datos
"SQLite", "Room", "Firebase Realtime", "Firestore",
// Cloud
"AWS Lambda", "S3", "EC2", "SNS", "GCP Foundation",
// Firebase
"Firebase Auth UI", "Firebase Storage", "Firebase Analytics", "Cloud Messaging",
// Testing
"UI Automator", "JUnit", "Espresso", "Appium"
];
for (const skill_item of skills) {
// Establece el valor en el input, pero React podría no actualizar su estado solo con esto
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(
window.HTMLInputElement.prototype, 'value').set;
nativeInputValueSetter.call(inputElement, skill_item);
// Crea y dispara un evento 'input' que React puede detectar
const inputEvent = new Event('input', { bubbles: true });
inputElement.dispatchEvent(inputEvent);
// Finalmente, simula la pulsación de Enter
const enterEvent = new KeyboardEvent('keydown', {
key: 'Enter',
keyCode: 13, // Código de la tecla Enter
bubbles: true, // El evento puede propagarse
cancelable: true // Se puede cancelar el evento
});
inputElement.dispatchEvent(enterEvent);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment