npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ionic-input-clearable

v1.0.0

Published

Clear Input value for ionic

Downloads

3

Readme

ionic-input-clearable

An Ionic AngularJS directive for adding a clear button to an input element.

#Table of contents

Demo

See it in action in the following image:

demo

Introduction

For one of my private projects, I needed a clearable input field component in Ionic (like jquery mobile one). I searched a lot and found some plain Angular clearable input field, but these had too much other dependencies and mostly didn't look that good within Ionic. Then . So I spent some time to create my one.

Features

The ionic-input-clearable component has the following features:

  • add clear button on the right side of the input field

Ionic compatibility

Tested on Ionic version 1.3.1

Installation

  1. Import the ionic-input-clearable javascript and css file into your HTML file:
<script src="sw2.ionic.input-clearable.js"></script>
<link href="sw2.ionic.input-clearable.css" rel="stylesheet">
  1. Add sw2.ionic.input-clearable as a dependency on your Ionic app:
angular.module('myApp', [
  'ionic',
  'sw2.ionic.input-clearable'
]);

Usage

To use the ionic-input-clearable directive you need set add ionic-input-clearable attribute to input field:

<input ng-model="searchkey" type="text" ionic-input-clearable />

REMARK: In order to let the clear button is clickable, please use "div" instead of "label" to wrap your input field.

Options

Add attribute:

"data-hideClearBtnOnBlur": hide the clear button when INPUT is blur

"data-input-clear-btn-class": change clear button class (default: ion-close)

<input ng-model="searchkey" type="text" ionic-input-clearable data-hideClearBtnOnBlur data-input-clear-btn-class="ion-close-circled" />

Version

v1.0.3 (2016-08-30)

  1. Add option to control the class for input clear button

v1.0.2 (2016-08-26)

  1. Minification and IE issue fix (by: monavari-lebrecht) [REMOVED, TO FIX]

  2. Add bower.json

v1.0.1 (2016-07-24)

  1. Add option for hide clear button on blur (same as ios style). (by: mopi1402)

  2. Bug fix for determine if element value is element. (by: mopi1402)

  3. Add CSS fade in/out effect to cancel button.

v1.0.0 (2016-07-19)

  1. Initial release

To do

  1. Set focus to input when user click on clear button.

  2. Add option to have a call back function after clicked on clear button.

... any other idea is welcome.

License

This Ionic clearable directive is available under the MIT license.

(c) sw2sonic | sw2hk.com