Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for additional input types. #58

Open
Bored0ne opened this issue Jul 5, 2018 · 3 comments
Open

Support for additional input types. #58

Bored0ne opened this issue Jul 5, 2018 · 3 comments

Comments

@Bored0ne
Copy link

Bored0ne commented Jul 5, 2018

This appears to only support standard "input" elements. Would it not be possible to bind to the value changed event for inputs to handle support for things like checkboxes or input buttons? I'm using this to test asp webforms and the default button is an and this isn't picking up their clicks. This could support the following list of types fairly easily. https://www.w3schools.com/tags/att_input_type.asp

@MynockSpit
Copy link

It currently does support button. That said if you pull this locally and install it as a developer package, you can change it to register clicks on everything. Something like this:

   start () {
     const typeableElements = document.querySelectorAll('input, textarea')
-    const clickableElements = document.querySelectorAll('a, button')

     for (let i = 0; i < typeableElements.length; i++) {
       typeableElements[i].addEventListener('keydown', this.handleKeydown)
     }

+    document.addEventListener('click', this.handleClick)
-    for (let i = 0; i < clickableElements.length; i++) {
-      clickableElements[i].addEventListener('click', this.handleClick)
-    }
   }

@Bored0ne
Copy link
Author

Bored0ne commented Jan 9, 2019

Wow I'm just seeing this. Yes that would work way better. Do people not want this by default?

@MynockSpit
Copy link

Actually, it should probably be tweaked more. The current pattern doesn't support elements that were created after the recording started. Will have to play with it more.

Not sure about it being defaulted. 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants