This element is compatible with Polymer 0.5 and lower only, and will be deprecated.
You can check out a similar 0.8-compatible version of this element at https://github.com/polymerelements/paper-input
See the component page for more information.
A text input à la Material Design
This element is compatible with Polymer 0.5 and lower only, and will be deprecated.
You can check out a similar 0.8-compatible version of this element at https://github.com/polymerelements/paper-input
See the component page for more information.
As shown in this example: http://jsbin.com/bogocigazuya/7/edit
When a multiline paper-input field is in a core-overlay, the content is only visible after you start typing in the field. No issue with non-multiline inputs.
<paper-input id="input"></paper-input>
<script>
addEventListener('polymer-ready', function() {
document.querySelector('#input').value = 10;
});
</script>
Exception in console:
Exception caught during observer callback: TypeError: undefined is not a function
at paper-input.inputValueForMirror (http://localhost/components/paper-input/paper-input.html:158:56)
If the format of a valid input is too complicated to be described by a single regular expression, it would be nice to specify the name of a JS function to validate the field, instead of the default pattern
attribute. It would accept a single string (the field value) and return a boolean result.
Obviously this can be done manually, but then you need to set up your own error reporting rather than being able to use the built in error
attribute of this component.
There may be other useful fields that html5 input controls have, but at the very least, there should be a require field where the field is invalid until there's content in the control.
I've only noticed this with Firefox. Chrome and Safari look ok. Haven't had a chance to test on IE yet
The default html input reports the current text as the value, updated in realtime as you type. paper-input does not do this, and only updates the value when the control loses focus. This makes it not work for a realtime suggestion feature using the oninput-event.
(As in: whatever value the input had when you focused it will be reported while you type, not the current value)
If you type some text in an input and then attempt to focus the right side of the text, the cursor is not placed correctly. This seems to be because the #caret element is obstructing the tap.
When inputValue is set to the empty string or null on a paper-input with a floating label, the label still floats, but only when the input has the default type -- password paper-inputs are unaffected. Setting the type explicitly to 'text' has no effect.
It's not possible to paste content via right-click or long-press on mobile.
When using paper inputs in Chrome with Vimium installed (default settings), typing in the input field produces strange behavior. E.g., attempting to type 'r' reloads the page, attempting to type 't' opens a new tab. This renders the paper inputs virtually useless for anyone using Chrome and Vimium.
This behavior is evident on Polymer's own paper inputs "demo" page.
What happens:
validated paper-input displays error messages on page load.
What should happen:
error messages should not be displayed on page load. Display messages after user input (on-blur), and before submit.
Every other form validation library, and html5 own do it this way.
Demo at: http://jsbin.com/ximudo/1/edit
Editorial: replicating html forms functionality is tough. I've never seen it done correctly.
When you change via javascript the value of a paper-input of type number to 0 (zero), the floating label doesn't update its position.
Here's a quick example:
<polymer-element name="input-test">
<template>
<paper-input id="paper" floatinglabel label="a number from 0 to 255" error="" min="0" max="255" type="number" ></paper-input>
</template>
<script>
(function(){
Polymer('input-test', {
ready: function(){
var self = this;
var observer = new PathObserver(this.$.paper, 'value');
observer.open(function(newValue, oldValue) {
self.onValueChanged(newValue, oldValue);
});
setTimeout(function(){
self.$.paper.value = 0;
}, 2000);
setTimeout(function(){
self.$.paper.value = 245;
}, 4000);
setTimeout(function(){
self.$.paper.value = 245;
}, 6000);
setTimeout(function(){
self.$.paper.value = 800;
}, 8000);
setTimeout(function(){
self.$.paper.value = 0;
}, 10000);
setTimeout(function(){
self.$.paper.value = '';
}, 12000);
setTimeout(function(){
self.$.paper.value = null;
}, 14000);
},
onValueChanged: function( o, n ){
console.group('changed!');
console.log('inputValue', this.$.paper.inputValue);
console.log('value', this.$.paper.value);
console.log('validity', this.$.paper.validity.valid);
console.groupEnd();
console.groupEnd();
}
});
}())
</script>
</polymer-element>
The code snippet below renders weird on firefox 29 & 31. It works on chrome. Screenshots included
On chrome:
On Fifrefox 31 & 29
The code:
<div horizontal layout>
<div flex>
<paper-input label="Name" floatingLabel required></paper-input> <br />
<paper-input label="Email" floatingLabel required type="email" style="margin-top:1em;"></paper-input>
</div>
<div flex>
<paper-input label="Name" floatingLabel required></paper-input> <br />
<paper-input label="Email" floatingLabel required type="email" style="margin-top:1em;"> </paper-input>
</div>
</div>
You can easily reproduce this by going to the demo page [1], and setting document.dir='rt'; in the js console.
The cause is that the caret and label css styles use "transform" tags, that don't automatically flip like "left" and "right".
[1] http://www.polymer-project.org/components/paper-input/demo.html
For elements with a validation pattern, the backspace key doesn't work. This behaviour occurs in the official demo and in my own tests. New characters can be entered, but nothing can be deleted. This occurs whether or not the text content matches the pattern. I'm using Chrome 36.
You can't use paper-input on a standard format to submit data, nor is there a standard password input.
paper-input on Firefox OS 2.0 doesn't work - it doesn't show keyboard.
How to reproduce - use Firefox OS 2.0 on this page: http://www.polymer-project.org/components/paper-input/demo.html
Video that demonstrates this problem:
http://youtu.be/aDBcCCjDYg4
Observed in paper-sampler.
Expected result
The previous input is immediately focused
Actual result
The focus leaves the second input but doesn't end up in the first input. Hit Shift-tab again. The first input is now focused.
paper-input renders incorrectly on IE: the label overlaps the input and the input shifts when text is typed into it.
http://jsbin.com/cewomuhi/1/edit
When adding a paper-input using appendChild, the animations for the floatingLabel don't work.
jsinb: http://jsbin.com/hiyiguxi/1/embed?live,html,console
You will see 2 change events in the console for a single change.
After packaging an app which uses paper-input using Vulcanize to run as a Chrome packaged app, I get the error
GET chrome-extension://obbfcbdgidailjmcfjdgmlojpdcifmhd/third_party/paper-input/error-100.png net::ERR_FILE_NOT_FOUND
If a paper-input with a floating label is placed inside a closed core-collapse then when you open the core-collapse and click on the paper-input, the label will not animate above the input box as it was supposed to.
It will, however, animate if it is placed inside an open core-collapse.
When you add a value programatically:
element[0].inputValue = value
The floatingLabel does not move from field:
Dirty fix:
attached: function() {
if (this.multiline) {
this.resizeInput();
window.requestAnimationFrame(function() {
this.$.underlineContainer.classList.add('animating');
}.bind(this));
}
if (this.inputValue !== "") {
this.$.label.classList.toggle('hidden', this.inputValue);
this.$.floatedLabel.classList.toggle('hidden', !this.inputValue);
}
}, ...
I added a inputValue check on attached event.
I've seen this after setting the inputValue either as an attribute or via the property. Placeholder is in an incorrect state in the middle of the input control and overlaps with the input itself.
I want to set the input value using value attribute:
<paper-input value="Hello World"></paper-input>
But the input shows empty value.
This may be related to googlearchive/core-input#1 but I also see paper-input.ready is calling core-input.inputValueChanged() which seems to reset the value to "".
When doing the following, everything works fine:
<paper-input multiline label="Enter multiple lines here"></paper-input>
I see an input that says "Enter multiple lines here", and it grows as I start hitting enter for newline characters. This is awesome.
However, the following does not appear to work:
<paper-input multiline label="Enter multiple lines here" value="sdsffsf"></paper-input>
Adding the value attribute cause things to break down, and I no longer see the paper-input field on my page. Meanwhile core-input behaves as I would expect
<input type="number">
is really nice in that you can increment/decrement using the keyboard arrows. It would be killer if the editable field of paper-input also allowed that.
Realizing this inherits from core-input...that would have to be something that's configurable on that element?
Here are a couple of random suggestions for simplifying the layout of paper-input:
Currently the online demo at http://www.polymer-project.org/components/paper-input/demo.html works.
But the demo at http://www.polymer-project.org/components/paper-elements/demo.html#paper-input fails on ios. The keyboard is shown, but when typing nothing is shown in the fields.
Repro:
:"><img src=404 onerror=alert(1)>
into the multiline inputHi,
Is there an exposed control for changing the label and underline (and effects) colors especially during focus?
I'm asking because I tried putting the paper-input element in a page with a dark background.
Thanks.
As the user types in content into the input field, the contents should be obfuscated at the UI layer, just HTMLInputElement.type = "password"
Loading a paper-input element with an initial bound value equating to zero (0) does not cause the label to float when floatinglabel=true. Typing zero into the input does cause the label to float, but loading the value attribute with a bound value equating to zero does not. Probably a faulty boolean check...
<paper-input id="ZeroTest" label="ZeroTest" value="{{data.zerovalue}}" floatinglabel="true" required="true" readonly="false"></paper-input>
It seems that some properties (like label, floatingLabel) are missing in metadata.html
Here is the broken input, the input line goes above the placeholder
and following is part codes of the form
<style>
:host {
display: block;
position: relative;
background-color: white;
padding: 20px;
width: 400px;
font-size: 1.0rem;
font-weight: 300;
border-radius: 2px;
}
</style>
<paper-shadow z="1"></paper-shadow>
<div layout vertical start-justified>
<div horizontal layout start-justified>
<div class="card-label" flex>Create XX</div>
<paper-icon-button icon="close" on-click="{{ onClickClose }}"></paper-icon-button>
</div>
<paper-input label="name" floatingLabel inputValue="{{ obj.title }}"></paper-input>
<paper-input multiline floatinglabel label="description" rows="3" inputValue="{{ obj.description }}"></paper-input>
<paper-fab icon="check" class="fab-success" self-end on-click="{{ onClickSubmit }}"></paper-fab>
</div>
Could you guys please have a look?
Tested here:
http://www.polymer-project.org/components/paper-input/demo.html
in iOS 7.1.1 with an iPhone can focus into an input (though this can also be flaky) and see the focus animation. Keyboard comes up, but typing never shows up in the input.
On the emulator, the inputs work so this is an issue on real devices only.
disabled
state should set aria-disabled="true"
aria-hidden="true"
, since the internal input gets an aria-label
with the same textKeyboard is not automatically hidden after losing focus by tapping outside the input element. This is happening in iOS with Safari browser.
The main problem is that user navigates through the app with the keyboard opened, hiding sections of the app. User has to close keyboard manually and this is not very user friendly.
Something like in https://github.com/PolymerLabs/typeahead-input/
From @term1nal (originally reported in dart-archive/paper-elements#44):
Firefox 31, Ubuntu 14.04 Unity
- On the expanding multi-line input, you continue to add new lines, the blue line continues to push its way down the page, but the text input area stays the same initial size, and just scrolls down. Also, this pushes elements down below the main card. It does not continue to expand downward, inhibiting access to elements that get pushed off of it (scrolling the page does not work).
- Pixel alignment is off with the static multi-line, making the line cut into the text.
sample: http://www.jmuk.org/etc/input-tabindex.html
I added tabindex to two paper-input elements. By pressing tab keys, weird 'no-one-focused' status is inserted between the two input elements.
As I quickly checked this a bit more, I realized that <paper-input> itself becomes focusable if tabindex is specified, although the actual focus should be in the input element under the shadow root. This can be fixed by adding on-focus and on-blur on <paper-input> itself.
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.