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

Software keypad only able to select one input #2944

Closed
MCGallaspy opened this issue Feb 5, 2015 · 11 comments
Closed

Software keypad only able to select one input #2944

MCGallaspy opened this issue Feb 5, 2015 · 11 comments
Assignees
Milestone

Comments

@MCGallaspy
Copy link
Contributor

On the develop branch, if multiple inputs are available, then the software keypad only writes to the "first" one. For example, this exercise could have multiple elements with .perseus-input class (which is how the sw keyboard selects its input, I believe). This is potentially an issue with Khan exercises too, though in that case I think the sw keypad selects the input element by ID(?) which might suggest it's meant to be unique.

@rtibbles
Copy link
Member

rtibbles commented Feb 5, 2015

I think the original design was intended to just disable the software keyboard when there were multiple inputs, although it is very likely that this is broken now with the Perseus integration.

The most reasonable design seems to be to add a 'next input' button to the software keyboard, which would be made visible if there were multiple inputs. Alternatively, we could just add an 'enter' key which would cycle, and submit once inputs were exhausted.

@aronasorman
Copy link
Collaborator

I feel that this isn't critical for the release. @cpauya why do you think this is a blocker?

@cpauya
Copy link
Contributor

cpauya commented Mar 2, 2015

If we have another form of input, aside from the keypad, we can remove the "high priority" flag.

@amodia can you put another example of the exercise using text boxes with screenshots?

@mrpau-richard
Copy link
Contributor

Hi @MCGallaspy and @rtibbles i replicate this issue on this exercise http://127.0.0.1:8008/learn/khan/math/early-math/cc-early-math-counting-topic/cc-early-math-counting/count-from-any-number/ but i have a problem on the textbox focus i can't identify the selected textbox of the user when keypad is active because the textbox is readonly.

screen shot 2015-03-02 at 5 42 38 pm

@MCGallaspy
Copy link
Contributor Author

@amodia I'm not sure I understand the problem. Can you elaborate?

P.S. On line 20 of software-keypad.js all the input elements are selected and stored as an array this.inputs, so you should be able to access them that way. Can you implement a button that simply loops this.field of the SoftwareKeyboardView through the available elements in this.inputs?

@rtibbles
Copy link
Member

rtibbles commented Mar 4, 2015

As @MCGallaspy says, this is the desired behaviour. The inputs are readonly on purpose, as it prevents a tablet on screen keyboard from popping up when the keypad is shown.

@mrpau-richard
Copy link
Contributor

Yup thanks I'm still working on this now @rtibbles

@mrpau-richard
Copy link
Contributor

@MCGallaspy my progress for today is i able to create a loop on this.inputs.

screen shot 2015-03-05 at 2 12 49 pm

and identify the input element to be used by the keypad by adding an id when user click it.

@mrpau-richard
Copy link
Contributor

@MCGallaspy I have a problem on this line of code at ka-lite/kalite/distributed/static/js/distributed/software-keyboard.js.

screen shot 2015-03-05 at 3 25 09 pm

Any suggestion how this work.

@rtibbles
Copy link
Member

rtibbles commented Mar 5, 2015

Hi @amodia - basically, this selects the particular input we want to set the value to (but only if the exercise is a Perseus exercise - if it is just a Khan Exercises exercise, it works fine for us to just set the field value directly).

The reason for this is because Perseus is using react.js, and so there is strict one-way data binding between the 'itemRenderer' object and the input fields, so if we don't set the data in this way, the value is lost.

In practice, this means that if you are allowing people to move across all the inputs, you need to just index into inputPaths[0], inputPaths[1], inputPaths[2] - depending on whether the user is on the first, second, or third input, etc.

@mrpau-richard
Copy link
Contributor

Thanks @rtibbles that was very helpful.

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

No branches or pull requests

5 participants