I am trying to set the cursor on the textbox that has been set to a kendoAutoComplete, but the cursor does not show.
Using Kendo's AutoComplete basic demo I am running the following code in the Chrome Developer console, but the cursor is not showing.
$('#countries').focus()
When the code is run, I do see that the span around the input box does get the 'k-state-focused' class which changes the border color to gray, but that's all it does.
From what I can tell, the 'k-state-focused' css class doesn't hide the cursor. So not sure if Kendo is somehow intercepting the focus in JavaScript and not setting it, or because the textbox has a span around it, the focus is being hidden.
Instead of $('#countries').focus() do $('#countries').data("kendoAutoComplete").focus().
Due to Kendo UI decorations around HTML elements you should use AutoComplete focus.
The first answer didn't work for me. It could be because I'm using UI for ASP.NET Core, but this solution did work:
$(document).ready(function () {
setTimeout(function () {
$("#myInputId").focus();
});
});
This is the explanation from Telerik - "The AutoComplete widget is designed to persist the focus of the input when popup element is clicked. The select is raised between of the open->click->close chain and that is why we will need to use setTimeout function to focus other input."
Related
I am working on AEM Classic UI and I want to add a checkbox widget inside dialouge and to add a tooltip on it. Is that possible to add a tooltip or on mouse hover text inside dialogue on cq widgets? If possible, how can we implement it?
I found the solution.
The answer is NO. We can't implement direct tooltip inside dialogue box.
But we can implement a short text that works like tooltip.
eg:
feildLabel = <p title="Trust me! I am tooltip!!">Hover over me</p>
Note: In the above example, the tooltip text will appear only if we place the mouse over the base text for more then 1 second. There is an delay for a second.
We can implement tooltip in classic UI. Here below I gave the node structure to implement that.
Node Structure:
=> nt:unstructured
=> tooltip
jcr:primaryType = nt:unstructured
autoHide = true(Boolean)
title = title for tooltip
text = text for tooltip
I've implemented an autocomplete multi-select field based on the Downshift with Popper Material-UI demo. That worked well up until I tried to reuse the component within a Material-UI Dialog. The Popper appears behind the mask of the Dialog.
I've modified the Material-UI demo as an example of this behavior: https://codesandbox.io/s/76moj1mq1.
Looking at Material-UI's old auto-complete solution, it use to use Popover instead of Popper. I tried substituting that in to see if it's z-index would be higher than that of the Dialog, but I think Popover steals focus from Downshift in a way that triggers the autocomplete to close immediately after it opens. Here's an example, again modifying Material-UI's demo https://codesandbox.io/s/wk84p1myz7.
Any ideas on how I can make either approach work?
Overriding z-index on the Popper to be above the 1300 that Material-UI defaults dialogs to works, but I was hoping to avoid having to do that if possible.
I'm using tinyMCE on modal bootstrap, I want to use the custom color plugin to add color that doesn't exist on the tinyMCE..
I know the color code that I want to use, but I can't focus to the textbox to input my color code on custom color popup
How to fix this ?
The Bootstrap modal has code that stops anything else from getting focus while it is enabled (by design). You should be able to override this with code like the following:
$('#myModal').on('shown.bs.modal', function() {
$(document).off('focusin.modal');
});
(This assumes you are don't mind using jQuery)
does anybody know if it's possible to manually resize a Codemirror textbox? What I mean is for example Firefox has this feature that you can manually drag a textarea item - but via Codemirror this doesn't work.
No cross-compatible browser support is needed, if we can find something only for Firefox, that's fine.
Thanks!
You'll have to write some code -- add a handle element, overlay it on the bottom-right corner, and register handlers that call the .setSize method on your editor instance when the element is dragged.
I want suggestions in suggestBox that is constructed from TextArea to be shown under the current line in text area, because by default it is shown under the whole text area. How can i implement such functionality?
Looking at the source code of SuggestBox, seems like you'll probably have to implement your own SuggestionDisplay, since the default one uses PopupPanel to show suggestions, which is positioned bellow the suggest box:
// Show the popup under the TextBox.
suggestionPopup.showRelativeTo(positionRelativeTo != null
? positionRelativeTo : suggestBox);
Your implementation could also use a PopupPanel but with a setPostion(x,y) and show() instead of showRelativeTo.