PolymerElements / gold-phone-input

An input element that only allows phone numbers
https://webcomponents.org/element/PolymerElements/gold-phone-input
13 stars 30 forks source link

Expose international format value #64

Closed masonlouchart closed 8 years ago

masonlouchart commented 8 years ago

This commit adds a computed property "internationalValue". This new property is the value prefixed by the country code (if there is one).

fixes #21

masonlouchart commented 8 years ago

🙏 (@notwaldorf doesn't forget this one)

notwaldorf commented 8 years ago

Honestly, I will merge this because I can't think of a better way to do it. It won't be the value submitted to a form, for example, which I think is bad, but I guess you can just use a hidden input field bound to internationalValue for this one element

masonlouchart commented 8 years ago

Don't feel forced to merge anything. I haven't thought of send the international value through a form. Simply by pointing this lack I could understand and work on it or you reject the PR. Thanks for the message.

notwaldorf commented 8 years ago

I merged and released it 🎉 This was a thing that was asked for a while, so it's a good feature, despite it being annoying in a form :)

I think to keep value the correct, international one, you'd have to use a separate property like (phoneNumber or something, and make value a computed property), which would be a breaking change anyway