question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ion-searchbar "value" attribute not working anymore

See original GitHub issue

Ionic version: (check one with “x”) [ X] 3.1.0

I’m submitting a … (check one with “x”) [X ] bug report

Current behavior: Just updated to ionic 3.1.0. After using “ionic serve” the “default” value of ion-searchbar does not get shown in the input field of ion-searchbar anymore.

Code: <ion-searchbar color="primary" debounce="150" value="**THIS DEFAULT VALUE IS NOT SHOWN ANYMORE**" (ionInput)="function($event)"></ion-searchbar>

Expected behavior: The Text of value shout be inside the ion-searchbar input field.

Steps to reproduce: Just use the ion-searchbar with the value attribute.

Related code:

<ion-searchbar color="primary" debounce="150" value="**THIS DEFAULT VALUE IS NOT SHOWN ANYMORE**" (ionInput)="function($event)"></ion-searchbar>

insert any relevant code here Other information:

“dependencies”: { “@angular/common”: “4.0.2”, “@angular/compiler”: “4.0.2”, “@angular/compiler-cli”: “4.0.2”, “@angular/core”: “4.0.2”, “@angular/forms”: “4.0.2”, “@angular/http”: “4.0.2”, “@angular/platform-browser”: “4.0.2”, “@angular/platform-browser-dynamic”: “4.0.2”, “@ionic-native/core”: “3.4.2”, “@ionic-native/geolocation”: “^3.4.4”, “@ionic-native/keyboard”: “^3.5.0”, “@ionic-native/screen-orientation”: “^3.5.0”, “@ionic-native/splash-screen”: “3.4.2”, “@ionic-native/status-bar”: “3.4.2”, “@ionic/storage”: “2.0.1”, “@types/googlemaps”: “^3.26.8”, “ionic-angular”: “3.1.0”, “ionicons”: “3.0.0”, “rxjs”: “5.1.1”, “sw-toolbox”: “3.4.0”, “zone.js”: “^0.8.5” }, “devDependencies”: { “@ionic/app-scripts”: “1.3.4”, “typescript”: “~2.2.1” },

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Your system information:

Cordova CLI: 6.5.0 Ionic Framework Version: 3.1.0 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 Ionic App Scripts Version: 1.3.4 ios-deploy version: Not installed ios-sim version: Not installed OS: Windows 10 Node Version: v6.9.3 Xcode version: Not installed

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jgw96commented, Apr 27, 2017

Hello all! After some further snooping on this issue I figured out that this is not actually an issue, but is simply how angular data binding works. If you use ngModel on an input in angular it will always overwrite the value attribute. If you want to set a default value you can set the value the ngModel is bound to that default value.

1reaction
jgw96commented, Apr 26, 2017

Hello, thanks for using Ionic! I can confirm that this is a legit issue. We will look into this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ion-searchbar "value" attribute not working anymore #11384
Current behavior: Just updated to ionic 3.1.0. After using "ionic serve" the "default" value of ion-searchbar does not get shown in the input ......
Read more >
Ion-SearchBar not working properly
i have an array that i use to populate and i'm using the ion search-bar so the user can search for an item...
Read more >
Placeholder on ion-searchbar not working - Ionic Forum
The input's placeholder shown is “Search”, the default value. Assuming that you want to assign the string value “Busca” to the placeholder ...
Read more >
Building an Ionic 4 Pokédex with Search, Infinite Scroll & ...
Some attributes are not formatted as an Array which makes working with the data harder. You could tackle all these issues at the...
Read more >
Mobile App Development with Ionic, Revised Edition
techniques to resolving issues that can arise during development. ... But Ionic components are also extended through additional attributes like:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found