Perspective Table Column Embedded Drop Down View Disappearing

I have an embedded dropdown menu within a table column. When I click on the dropdown the menu appears for a split second and then instantly disappears before I can select anything. If I hold down the dropdown option it stays and gives me a chance to click an option, but as soon as it populates the table it disappears.

image

column parameters:
image
dropdown parameters
image

dropdown action performed script

def runAction(self, event):
	"""
	This event is fired when the 'action' of the component occurs.

	Arguments:
		self: A reference to the component that is invoking this function.
		event: An empty event object.
	"""
	column = self.view.params.column
	row = self.view.params.rowIndex
	value = self.view.params.value
	messageType = 'UpdateColumn'
	
	payload = {'column':column, 'row':row, 'value':value}
	
	system.perspective.sendMessage(messageType, payload, scope='page')

table Message handler

def onMessageReceived(self, payload):
	"""
	This method will be called when a message with the matching type code
	arrives at this component.

	Arguments:
		self: A reference to this component
		payload: The data object sent along with the message
	"""
	column = payload['column']
	value = payload['value']
	row = payload['row']
	
	self.props.data[row][column] = value

table on edit complete, although it's my understanding that this shouldn't matter for an embedded view

def runAction(self, event):
	"""
	Fired when a user has effectively committed an edit on a cell via return or
	enter key press.

	Arguments:
		self: A reference to the component that is invoking this function.
		event: An object with the following attributes:
			column (str | int): The column of the edited cell.
			row (int): The unique row index as it is represented in the source
			           data. Also known as the row ID.
			rowIndex (int): The row index as it is represented in the current
			                visible data.
			value (int | float | bool | str): The committed value.
	"""
	#update dataset with edited value
	dataSet = self.props.data
	newDataSet = system.dataset.setValue(dataSet, event.row, event.column, event.value)
	self.props.data = newDataSet

Thanks!

I wonder if the problem is being caused by the enableColumnSelection being set to False. Try setting it to "true" and see if that corrects the behavior:
image

image
That's a good guess but it didn't work.

1 Like

I found the issue!
image
I had allowEditOn single click, and for whatever reason that makes the dropdown disappear as soon as it opens. If I switch it to double click or long click it works how I would expect it to.

What's weird is that to open the dropdown it only takes a single click, but my other components it takes a double click.

Is it possible to change this setting based on the column so I can only apply the double click to the dropdown? Thanks!

1 Like