![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
ember-mobile-inputs
Advanced tools
DEMO: http://annotationsro.github.io/ember-mobile-inputs/
HTML 5 introduced input types that are really great for mobile devices, but not that great for the good old desktops. Mainly because every browser implements it in a little bit different way (speaking of UI), which is sometimes not that great (e.g. number input in Firefox on Windows is simply disgusting...). And of course they are sometimes a little bit buggy (looking at you Firefox....) Also, it would be sometimes nice to enhance or alter the way these inputs behave on desktop - give them a little bit more glamour, right?
So what this addon does? On mobile (touch) devices it makes use of HTML5 power (renders a simple HTML <input type="whatever">
) and on desktop it provides some extra fun:
Requires Ember >= 2.15.0 because of Ember.assign - or use a shim
ember install ember-mobile-inputs
This addon uses JQuery, so do not forget to add it to your application via ember-jquery.
{{mobile-input id="numberInput" type='number' value=valueNumber disabled=isDisabled onValueChanged=(action 'callback')}}
You can customize the decimal point mark - whether to use comma or dot or both. You can do this by setting decimalMark
attribute to:
You can limit number to be positive only by parameter allowNegative=false
.
{{mobile-input id="textInput" type='text' value=valueText disabled=isDisabled onValueChanged=(action 'callback')}}
You can also define regex pattern for text input fields using pattern
attribute. Note: regex must work also for intermediate states, not just final value.
{{mobile-input id="passInput" type='password' value=valuePass disabled=isDisabled onValueChanged=(action 'callback')}}
With default date format - dd.mm.yyyy
{{mobile-input id="dateInput" type='date' value=valueDate disabled=isDisabled onValueChanged=(action 'callback')}}
With custom format
{{mobile-input id="customDateInput" type='date' value=valueDateFormat format='YYYY-MM-DD' disabled=isDisabled}}
showOn attribute with possible values:
You can add a global configuration into your config/environment.js file:
ENV['ember-mobile-inputs'] = {
date:{
calendarButtonClass: 'fa fa-calendar', // font icon CSS classes to be used in place of calendar button
format: 'd.m.Y', //see Flatpickr formatting
locale: 'en', //see Flatpickr i18n
showOn: 'both' //available options: 'both', 'input', 'button', 'none',
},
number:{
decimalMark: 'both', //available options: 'comma', 'dot', 'both'
selectOnClick: false, //selects the whole number on focus
formatOnDisabled: false //format numbers when input is disabled
},
text:{
selectOnClick: false //selects the whole text on focus
}
}
For more Flatpickr (calendar popup) configuration information, please have a look at the Flatpickr guide.
You can also pass flatpickrOptions
parameter to the component - this is currently used only by date input to customize Flatpickr calendar (content of flatpickrOptions
is merged with Flatpickr config).
You can also configure other options for inputs in options
attribute - list of supported options:
There is an option to add callback onBlurChanged
that will be called on input blur, but only when value has changed since on-focus event.
There is a service mobile-input-event-bus
where you can subscribe to input changes on input blur - don't forget to enable these events in the config:
config/enbironment.js
ENV['ember-mobile-inputs'] = {
eventOnBlurChanged: true
}
subscribe for events
mobileInputEventBus: Ember.inject.service('mobile-input-event-bus'),
this.get('mobileInputEventBus').subscribe('blurChanged', (newValue, oldValue, element)=>{
window.console.log(`EVENT: newValue: ${newValue}, oldValue: ${oldValue}`);
});
You can pass custom attributes to the element using data-custom
attribute:
{{mobile-input value=value data-custom="hello world"}}
which will render:
<span data-custom="hello world" class="ember-mobile-input ember-mobile-input-text ember-view">
<!-- some more stuff here -->
</span>
FAQs
Mobile- and Desktop- friendly inputs
The npm package ember-mobile-inputs receives a total of 0 weekly downloads. As such, ember-mobile-inputs popularity was classified as not popular.
We found that ember-mobile-inputs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.