Grab node without select (Cytoscape.js) - cytoscape.js

When I move a node with the mouse, it automatically becomes selected. I want the node to become selected only when I tap on it. How can i do this?

You can try playing with autounselectify You can set it to false and when tap happens, you can set it to true or etc.

Related

vue-treeselect: stop clearing the input after hitting enter key

Using https://vue-treeselect.js.org, after I select any option using the enter key, this is the state of the component:
As you can see, the option that had focus when the enter key was actually selected, but the input doesn't close, it still has a typing focused cursor state, and the selected option actually appears as a faded-out placeholder.
What I wanted to achieve is, after the user hitting enter to select the focused option, the state of the component should be equal if the option was selected via mouse, which is like this:
As you can see, the option appears as selected and there's no cursor blinking anymore, because the selection was already made.
I thought this was controlled by the props closeOnSelect and clearOnSelect, but weirdly their description seems to indicate this is the desired behavior when you're using a single select mode (which is the case here):
clearOnSelect Type: Boolean - Default: Defaults to false when :multiple="true"; always true otherwise. Whether to clear the search input after selecting an option. Use only when :multiple="true". For single-select mode, it always clears the input after selecting regardless of the prop value.
closeOnSelect Type: Boolean - Default: true - Whether to close the menu after selecting an option. Use only when :multiple="true".
Isnt't there any way around this other than forking the component? I tested it like this with some users and all of them seem confused after hitting enter (it doesn't appear that a selection was made and it's still waiting for keyboard input).

Unable to break from the if condition and cannot click on element

I have a svg file and i need to click on the seats, So i have used driver.findelements() when a seat is clickable it should click on it and come out of the if condition. But when i use break it is not clicking the seat, When i do not use break it will go into infinite loop.
How do i break after the seat is selected.
Please find the attached code
Make recursive function which keeps on checking that element is enabled or not.
once it is enabled , it will click and come out.
def click_enabled_element(enable_value = False)
if enable_value:
i.click()
return
else:
click_enable_element(i.isEnabled())

How to know the index of a node selection in a multiple selection?

Suppose you enabled box selection in cytoscapejs or you do something like:
cy.nodes().select();
when the user clicks a button. So, the user is able to select multiple nodes at once.
When registering the handler for the select event on nodes:
cy.nodes().on('select', function(evt){
...
}
Is there any way to know if the selection of a node is due to:
A single selection event (i.e. the user just clicked on a single node)?
A multiple selection event (and which index the current node is in this multiple selection)
Thanks!
You can track the events coming in to determine the type of selection (i.e. tap versus tapstart-tapdrag-tapend / tap versus box). You can keep a counter, declared outside the event callback, to track element indices if you want --- though the indicies won't really mean anything.

How do I highlight the content of a TextBox/RefEdit control and set focus simultaneously?

I'd like to highlight the content of a TextBox/RefEdit control and set focus simultaneously when there is any invalid entry and after prompting a message box warning the error so that user knows where to fix the error. You can try Data>Analysis>DataAnalysis>Sampling and enter some invalid range/data, then you will be redirected to the invalid entry. The invalid entry is highlighted as well as with focus set (you can see a flickering cursor).
I tried to emulate this and I used,
aControl.SetFocus
aControlt.SelStart = 0
aControl.SelLength = Len(aControl.Text)
While the content inside the control is highlighted in blue, there's no flickering cursor as if I did not set focus of the control. How can I fix this? Or what's the best way to guide the user to the place where the invalid entry exists?
What if user inputs more than one invalid entries. How do you plan them all selected and setfocused at the same time.
There is no need to complicate things for you and for user. What you can do is create invisible labels with the right message you want to deliver to user, preferably in red color, and place them below each TextBox/RefEdit. Make them visible with Label1.Visible = Truewithin your conditional check.

How would I triple-click in Sikuli?

I am trying to select an entire line of text on a web page (in a table) using Sikuli. The easiest way to select the text is to "triple-click" on it. Is there a way to triple-click in Sikuli?
Thanks!
GregH,
I got the following to work for me:
click(img.png)
mouseDown(Button.LEFT)
mouseUp(Button.LEFT)
wait(0.01)
mouseDown(Button.LEFT)
mouseUp(Button.LEFT)
This allowed me triple click on a button, link, or whatever I needed to click on.
This works for me:
def tripleClick(PSMRL):
hover(PSMRL)
for x in xrange(3):
mouseDown(Button.LEFT)
mouseUp()
quick fix solution would be to check out the mouse settings in control panel and you can lower the time between clicks required to register successive clicks needed to perform the 'triple click' action
Have you tried low level mouse functions? Something like this should work:
for x in xrange(3):
region.mouseDown()
region.mouseUp()
Depending on what is being clicked, sometimes, the click type is the same as multiple clicks in succession. Meaning, if what needs to be clicked doesn't have to be double/triple-clicked very fast, then you can just use a sequence of single clicks. 2 clicks = double-click, 3 clicks = triple click. I know that 2 clicks will simulate a double-click on Windows desktop (not sure about things like games, etc.)
I've seldom heard of a triple-click action though.
So, have you tried using 3 clicks to simulate triple-click to see if that works or not?
I f you use .click() will be good enough.
.click() is the left mouse button, .rightClick() is the right mouse button.
For example:
image1 = ("image1.png")
def multiClick(nTime):
imageLoc = find(image1)
for n in xrange(nTime):
imageLoc.click()
# Click 3 times.
multiClick(3)