nkezhaya / live_phone Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Are there any example tests that show how to make live_phone
work with a standard live view test, using the form
and render_submit
functions?
When I try to test I get an error:
** (ArgumentError) value for hidden "contact[phone]" must be one of [""], got: "+55 (11) 98123-1234"
code: |> render_submit()
I believe these can be found in Google's libphonenumber
When i am changing country flag america to UAE it should display format of UAE
but its keeping in same 5555555 format
Instead of having priv/assets
in the repo we should have a CI task that copies the files.
Thoughts on using hound?
First of all, thanks a lot for putting this library together!
I couldn't find documentation on using this inside a Phoenix (Liveview) form. Still, I adapted the example to do it like this (I'm on Phoenix Liveview 0.18, so there is no longer the need to import the socket on a live component):
<%= live_component(LivePhone.Component, id: "dp_mobile_phone", form: f, field: :dp_mobile_phone, apply_format?: true, preferred: ["US", "GB", "CA"]) %>
That seems to work alright when the form is used for the first time:
However, when I returned to the form for a second time, the country was set to the US again. I expect the country to be set based on the stored country code and not show the +31 (in this example) in the input field. Am I missing some initialization in the above code, or has this not come up before?
Furthermore, would it make sense to be able to pass (optional) parameters for the CSS class on the component so I can easily make this phone field look the same as my other inputs?
http://estelle.github.io/input-masking/
This method seems decent?
Added this to a app and I receive the following message.
Also tried the suggestion of adding {:phoenix_html_helpers, "~> 1.0"}
. But message doesn't change.
==> live_phone
Compiling 3 files (.ex)
== Compilation error in file lib/live_phone.ex ==
** (RuntimeError) use Phoenix.HTML is no longer supported in v4.0.
To keep compatibility with previous versions, add {:phoenix_html_helpers, "~> 1.0"} to your mix.exs deps
and then, instead of "use Phoenix.HTML", you might:
import Phoenix.HTML
import Phoenix.HTML.Form
use PhoenixHTMLHelpers
(phoenix_html 4.1.1) expanding macro: Phoenix.HTML.__using__/1
lib/live_phone.ex:8: LivePhone (module)
(elixir 1.16.2) expanding macro: Kernel.use/1
lib/live_phone.ex:8: LivePhone (module)
could not compile dependency :live_phone, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile live_phone --force", update it with "mix deps.update live_phone" or clean it with "mix deps.clean live_phone"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.