I want to be able to search right after the webpage is rendered, instead of click on the search box then start typing.
However when I trying to mimic focusInput in original source code, it doesn't work.
It could be reproduced by visit
https://ember-power-select.com/docs/multiple-selection
and run document.querySelector('.ember-power-select-trigger-multiple-input').focus() which is focus on an input tag.
I expected to see something like this
, but actually nothing happened.
I also tried to .click() on all parent html elements of that input, but nothing happened
Any help?
I would suggest a tabindex to you. When you set the tabindex to 1 the search field will be the first to focus.
As an alternative you can try to achive this with an application instance initializer. In it you can now select the proper element and set the focus on it.
Related
I have gotten the autocomplete to work with my Database and my front end, but the input widget looks slightly off.
Is there a way to change the styling for the input?
Also, is there a way to remove the initial dropdown, so after you click once, you can start typing and suggestions will appear? I am using the ListSelect2 Widget. The Select2Multiple looks like more of what I need but I want input to be only one.
Current Widget Pre-Input
Current Widget During Input
Current Widget After Selection
Desired Look (Select2Multiple Widget)
I would appreciate any suggestions!
I built an Angular Reactive Form using Ionic 2.
When I was touching an input at the bottom of the page the page would scroll so the input get above the keyboard. Expected behavior, so ok. But the header was push too and that was wrong.
So I looked on the internet and find a workaround which was to write the following in the import statement of app.module.ts
// app.module
IonicModule.forRoot(MyApp, {
scrollAssist: true,
autoFocusAssist: true
})
That indeed works well as the page still scrolls and the header is not push away.
But I still have one problème. When I touch an input which doesn't need the keyboard to be shown (eg. datepicker) the page scroll on the first touch and I have to touch again so the datepicker opens...
Any idea on how I could may be prevent the page to auto-scroll when touching an input that doesn't need the keyboard?
This could be possibly achieved by using two properties of input component. Firstly you can set the readonly property to true and then add the click Eventlistner to open the DatePicker and then use the placeholder property of input to show the value of DatePicker.
I hope this would help you find the solution. Let me know if this works.
Good Luck & Cheers
Ashish Sebastian
I have a form that contains a select box and a text field.
The text field is displayed dynamically based on the selectbox selection. If the value of selectbox is "Yes", then the text field will be displayed and vice versa.
I am running an rspec test and filled the select box value with "Yes"
select 'Yes', from: 'property[have_water_bills]'
Now i want to fill a value on the text field
fill_in 'property[irrigation_cycle_count]', with: 5
But i am getting the following error.
Capybara::ElementNotFound:
Unable to find field "property[irrigation_cycle_count]"
That is, capybara cannot find the dynamic element. Does anyone know how to fix this?
Poltergeist doesn't gemerate a click event when choosing an item from a select. It generates a focus on the option, change on the select, blur on the option. It is more like if a user selected the option with keyboard instead of using a mouse. You probably should be doing the logic to display your text field on the change event anyway so that it works if people use a mouse or a keyboard to navigate around your page. It also makes more sense to run your show/hide logic on the change event because that's what you actually care about, not clicks.
Finally got this to work using the following piece of code
page.execute_script("$('#have_water_bills').val('true').trigger('click')")
I have searched far and wide and cannot find anything online about my issue even though it seems rather trivial, and i feel like there's just something I'm missing, so I apologise if the answer is apparent.
However, when I use a QComboBox in Qt, When I click on it instead of dropping down like I want it to, it shows the popup with the current selected item as the origin. If that doesn't make sense this is what I am referring to:
It shows the popup starting at the current selected item where the button is. I just want it to drop downwards like any other normal combobox! How can i Achieve this? If i make it editable it drops down exactly how i want it, but i don't want it to be editable!
Does anyone know what's up?
Edit:
I am running Windows 10
I have an UltraComboEditor (Infragistics control) and the user can input values on it. I used the AutoComplete property to do that.
But now I have a problem. I need to make sure that my user can delete a value that he wrote. I use the function canUndo but it not works.
How can I solve my problem?
Thank you.
I will try to add a ButtonLeft element, perhaps with a red cross image.
Let the user select an item from the combobox and then he/she will press the button element to trigger the action to delete the current selected element.
In the EditorButtonClick event you should ask for a confirm, search into your items collection and then remove the one selected.