We finally removed the jQuery dependency! This changes how you initialise and use the plugin - see readme for details. All of the tests are currently passing on Chrome/Firefox/Safari/IE11.
- You can no longer initialise the plugin on multiple inputs at once, but other than that AFAICS it should be feature complete
- Instead of jQuery deferred objects we now use ES6 promises (if available)
dropdownContainer
option has changed from taking a jQuery selector string, to a node e.g.document.body
I also simplified the CSS media queries in this release, so let me know if you notice any problems with that.
- changed how hiddenInput option works, to make it compatible with initialising the plugin on multiple inputs at once (so now if your input name contains square brackets then it will give the hidden input the same name, replacing the contents of the brackets with the given name)
- removed an undocumented
utilsScriptDeferred
argument to static methodloadUtils
which is no longer needed - lots of bug fixes
- added new setPlaceholderNumberType public method
- added new hiddenInput option
- trigger new open/close dropdown events
- now triggers
close:countrydropdown
event
- Drop support for IE8 (see readme). There are no actual changes in this release, it just marks a line in the sand where future changes will no longer consider IE8.
- rename numberType option to placeholderNumberType
- rename formatOnInit to formatOnDisplay
- separate
allowDropdown
andseparateDialCode
options - make defaults object accessible from outside
- bug fixes
- updated autoPlaceholder option to accept "off", "polite" and "aggressive"
- BREAKING CHANGE: removed 2nd arg from setNumber
- optimize PNGs
- update libphonenumber to v7.3.2
- remove cookie stuff (easy to do yourself)
- added support for jquery 3
- added kosovo
- autoHideDialCode now works on submit as well
- added formatOnInit option (defaults to true)
- bug fixes (along with lots more tests)
- re-added getExtension method, which now uses libphonenumber internally for more reliable results
- added separateDialCode option
- added allowDropdown option (defaults to true)
- removed autoFormat functionality - see issue 346
- removed allowExtensions and getExtension as a result
- country dropdown now a custom full-screen popup on mobile
- rename country-change event to countrychange for consistency
- trigger countrychange event whenever the country changes
- set autoFormat option to default to false due to known UX issue
- trigger custom
country-change
event when user selects a country
- changed loadUtils to be a static method
- rename selectCountry to setCountry
- rename defaultCountry to initialCountry
- lots of tidy up and bug fixes
- added excludeCountries option
- added dropdownContainer option
- Made Sass variables overridable
- Updated libphonenumber to v7.0.11
- Added version number into js
- Added customPlaceholder option
- Added CommonJS support
- Lots of bug fixes
- BREAKING: Updated defaultCountry=auto system to use new geoIpLookup function option
- if set defaultCountry=auto and use jquery-cookie plugin, then store the loaded country code in a cookie for future use
- other bug fixes
- setNumber now accepts a 2nd format arg (only works for valid numbers)
- new wikimedia commons flag icons
- return a deferred object, so dev can use .done() to know when the plugin has finished initialising
- use a native select for dropdown on mobile
- retina flag icons
- on clear input: default to last selected flag
- other bug fixes
- Added allowExtensions option - defaults to false
- Empty state for flag when invalid dial code
- Removed preventInvalidNumbers as was wrongly using libphonenumber's AsYouTypeFormatter, which was broken and they explicitly said shouldn't be used for that
- Added default flash styling on autoFormat's invalid char event, which can easily be overridden
- Defaulted
nationalMode
to true because it's a better experience for the user - Rename
getCleanNumber
togetNumber
and take a format type arg - Remove
responsiveDropdown
option and just trigger automatically on small screens - Remove useless
setCountryData
method - Change flag CSS from
.intl-tel-input .flag
to.iti-flag
to reduce CSS filesize and allow easier re-use
- Added preventInvalidNumbers option
- Set autocomplete="off" on input to prevent inconsistencies
- Support readonly inputs
- Trigger
input
event when autoFormat is enabled
- ipinfoToken option, which is required for ipinfo https support
- bug fixes
- autoFormat feature: trigger custom
invalidkey
event on invalid key press so can give user feedback - tweak autoFormat delete key behaviour: no reformat if delete and cursorAtEnd, never add format suffix on delete - this should also fix an IE8 issue with autoFormat
- Added numberType option
- Can now set defaultCountry to "auto"
- Added public method getValidationError
- Updated libphonenumber
- Fail gracefully if call selectCountry with invalid countryCode
- Added loadUtils method
- Bug fixes
- Added public method getNumberType
- Added public method getCleanNumber
- Added support for maxlength attribute on the input
- autoFormat now prevents further input when the formatting fails i.e. no longer a potentially valid number
- Other bug fixes
- isValidNumber now works in nationalMode
- country-specific placeholders, which auto update (and also work in nationalMode)
- autoFormat now works for all countries as now uses libphonenumber (and now works in nationalMode too)
- cursor-to-end on tab (if autoHideDialCode enabled)
- handle North American Numbering Plan area codes (e.g. change to Canada if type "+1204")
- removed static formatNumber method as doesnt really make sense as relies on an instance of the plugin to load the utils script
- reduced filesize of data.js by generating allCountryCodes on the fly, and removing some obscure countries
- reduced filesize of flags.png by removing unused flags
- lots of bug fixes and new tests written
- Automatically format the number as the user types
- Full type-to-search in dropdown
- Removed defaultStyling option as hadn't seen anyone using it and it felt like bloat
- Removed dialCodeDelimiter option as superseded by autoFormat option
- Lots of other bug fixes and improvements
- reduced filesize from country data
- compress css to reduce filesize
- fixes to country data (canada and Caribbean Netherlands)
- more tests
- added public destroy method
- removed redundant defaultStyling=none option
- added responsiveDropdown option
- full type to search
- lots of bug fixes
- validation script now waits for the load event
- fixed issue with specificity on critical input styling
- when auto-inserting DC, if user hits + then assume typing new number so wipe the DC
- added allowNational argument for public isValidNumber method
- fixed issue with unbinding keypress event
- selecting another country then deleting the dial code no longer takes you back to the default country
- replaced americaMode with more generic nationalMode
- fixed issue on IE: selecting flag puts cursor at beginning
- position the dropdown above the input depending on layout/scroll
- added validation via the validationScript option
- fixed issue with autoHideDialCode option, where sometimes clicking the input to focus it would leave the cursor in the middle of the dial code (or to the left of it)
- improved vertical centering and made arrow smaller
- renamed option to dialCodeDelimiter
- 2 new examples (plus syntax highlighting on examples)
- fixed issue in firefox: vertical margin on input breaks alignment
- CSS tidyup / alignment fixes
- JS abstraction / tidyup
- arrow now points up while dropdown open
- added title attribute to selected flag (try hovering the selected flag!)
- added getSelectedCountryData public method
- fixed regression: input with vertical margin breaks flag alignment
- fixed issue with default delimiter and autoHideDialCode option
- allow dial code delimiter to be overridden
- Wrap in UMD (so that it supports AMD)
- fixed issue: enter on dropdown submits form
- improved default styling
- new flags
- updated country data to show 24 more countries
- abstracted lots of new functions from plugin init method
- Bug fixes
- Examples
- fire
change
event on the input when changing countries - fixed issue where dial codes were ignored if they had a space in
- fixed issue: changing flag doesnt update number when dial code contains space/dot etc
- lots more tests
- disabled dropdown/hover states when input disabled
- support inputs of any height
- fixed issue where hitting enter to select a list item didnt close the dropdown
- updated defaultStyling option to allow positioning selected flag outside input
- Removed initialDialCode option as made redundant by autoHideDialCode option
- Added defaultCountry option
- Option initialDialCode now defaults to false
- Added option autoHideDialCode, which defaults to true
- Added public method setNumber
- Added static methods getCountryData and setCountryData
- Fixed issues with instantiating the plugin on multiple inputs
- Added defaultStyling option
- Added localised country names in brackets
- Added some tests.