Git Product home page Git Product logo

Comments (5)

hodgef avatar hodgef commented on July 4, 2024

Hello @tjadea,

Generally for these kind of use-cases I ask people to provide a sandbox example showing the issue. Could you please edit the following demo as to show the problem, and provide the new link?

https://codesandbox.io/s/github/hodgef/angular-simple-keyboard/tree/master/?module=%2Fsrc%2Fapp%2Fapp.component.ts

I'll reopen the ticket once that's done.

Best,
Francisco Hodge

from simple-keyboard.

AmanChhabra-A746623 avatar AmanChhabra-A746623 commented on July 4, 2024

once I give fix value to "value" variable, backspace does not work and on clicking any key it starts new input. Ideally it should continue to add input after value which is given in input.

e.g I assigned value="abcd";

why is it so?

from simple-keyboard.

hodgef avatar hodgef commented on July 4, 2024

Hello @AmanChhabra-A746623,

You need to update the internal simple-keyboard input with your default value. To do that, check out setInput.

https://simple-keyboard.com/documentation/#setInput

Regards,
Francisco Hodge

from simple-keyboard.

pawel-elmi avatar pawel-elmi commented on July 4, 2024

Hello @hodgef,

It seems that I run into the same problem. However I didn't manage to make it working on codesandbox, because of some dependencies problem, have a look at the repo I prepared:
https://github.com/pawel-elmi/SimpleKeyboardForms

What I figured out is that the refresh of the reactive form depends on "input" event which simple-keyboard(later S-K) doesn't emit. This can be seen clearly when you type sth using S-K (i.e "qwerty") the input value is updated but the form value is not, unless you type any button on the physical keyboard - then the whole input shows up magically.

Maybe you can give me a hint, how to resolve this problem.

PL.

from simple-keyboard.

hodgef avatar hodgef commented on July 4, 2024

Hello @pawel-elmi,

If your 3rd-party dependency requires an event to be sent, you can send it yourself using dispatchEvent.

In your test repo, add the following line in the simple-keyboard onChange callback (after the input value is set):

(<HTMLInputElement>document.getElementById(this.inputName)).dispatchEvent(new KeyboardEvent('input'));

Please feel free to create a new thread if you run into issues.

Regards,
Francisco Hodge

from simple-keyboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.