How to set max height on react select - react-bootstrap

I'm trying to limit the height of a select list using the maxMenuHeight as follows:
<Form.Control as="select" size="sm" className="w-auto" maxMenuHeight={20} defaultValue={currentTimezone.timezone}>
{currentTimezoneList}
</Form.Control>
However, the select list continues to be full height:

I was able to solve this using the "htmlSize" property of Form.Control which is documented here:
https://react-bootstrap.github.io/components/forms/#form-control-props

Related

How to set height of items in droplist CComboBox

I am trying to set height for each item present in CComboBox drop list. I have setitemheight API but it is not changing height of each item in list. I have used SetFont as well but no automatic resizing either.
Problem seems like I have overridden DrawItem , hence I have made minor change there to fix issue:
GetLBText(lpDrawItemStruct->itemID, strText);
lpDrawItemStruct->rcItem.bottom += 2; // this solved my problem
dc.ExtTextOutW(
lpDrawItemStruct->rcItem.left,
lpDrawItemStruct->rcItem.top,
ETO_OPAQUE,
&lpDrawItemStruct->rcItem,
strText,
strText.GetLength(),
NULL
);

In QTP 12.51, how to identify dynamical element generated using ajax/jquery form?

In my Datatable three rows present.After clicking on Add button new row is generateed and i need to put input values from datatable.
Problem : How to identify field of each row dynamically for inserting values?
Script:--
Datatable.GetSheet(5)
rowcount=Datatable.GetRowCount
For i=1 to rowcount
Datatable.SetCurrentRow(i)
lenth =Datatable.Value(1,5)
width= Datatable.Value(2,5)
height= Datatable.Value(3,5)
weight=Datatable.Value(4,5)
piece=Datatable.Value(5,5)
Browser("Magma MCR").Page("Magma MCR").WebEdit("ship_info1[length_val]"Set lenth
Browser("Magma MCR").Page("Magma MCR").WebEdit("ship_info1[width_val]").Set width
Browser("Magma MCR").Page("Magma MCR").WebEdit("ship_info1[height_val]").Set height
Browser("Magma MCR").Page("Magma MCR").WebEdit("ship_info1[weight_val]").Set weight
Browser("Magma MCR").Page("Magma MCR").WebEdit("ship_info1[total_pieces]").Set piece
In this script,
Here for first row, web element name is "ship_info1[height_val]"
for next added row, web element name is "ship_info2[height_val]"
So, I want to select this web-element dynamically. Please see the attached image.
try code something like below
temp=1
temp=temp+1
Browser("Magma MCR").Page("Magma MCR").WebEdit("ship_info"&temp&"[length_val]").Set lenth
By the way, does QTP idetify that table in your application as web table?

UI Testing in Xcode 7: Selecting a row number in a UIPickerView / PickerWheel

Is there a way in Xcode 7 UI Testing to select the 3rd row in a UIPickerView?
I have tried various things like this to identify the rows in each picker but all the requests below return 0 found:
XCUIApplication().pickers.element.cells.count
XCUIApplication().pickers.element.staticTexts.count
Any ideas?
Updated: I am aware of adjustToPickerWheelValue method where you can select a particular value you already know, but I am trying to select the 3rd value (index = 4) when I don't know the values that exist in the picker.
You can use -adjustToPickerWheelValue: to select items on a UIPickerView.
When there is one UIPickerView on the screen you can select the element directly, like so.
let app = XCUIApplication()
app.launch()
app.pickerWheels.element.adjustToPickerWheelValue("Books")
If the picker has multiple wheels you will need to first select the wheel via it's accessibility identifier, then adjust it.
app.pickerWheels["Feet"].adjustToPickerWheelValue("5")
Here's a GitHub repo with a working example. And some more information in a blog post I wrote.
Workaround:
let pickerWheel = XCUIApplication().pickers.pickerWheels.element
let appWindowHeight = XCUIApplication().windows.elementBoundByIndex(0).frame.height
let pickerWheelCellHeight = GFloat(44)
func advancePickerWheelOneValue() -> Self {
let topScrollPoint = Double(pickerWheel.frame.midY/appWindowHeight)
let bottomScrollPoint = Double((pickerWheel.frame.midY + pickerWheelCellHeight)/appWindowHeight)
let topScreenPoint = XCUIApplication().windows.elementBoundByIndex(0).coordinateWithNormalizedOffset(CGVector(dx: 0.5, dy: topScrollPoint))
let bottomScreenPoint = XCUIApplication().windows.elementBoundByIndex(0).coordinateWithNormalizedOffset(CGVector(dx: 0.5, dy: bottomScrollPoint))
bottomScreenPoint.pressForDuration(0, thenDragToCoordinate: topScreenPoint)
return self
}
You may need to adjust the dx value depending on where the picker is.
.coordinateWithNormalizedOffset(CGVector(dx: 0.5,
But 0.5 works if the picker occupies the width of the screen.
With this method you an move the picker on value at a time. Call it multiple times and you get to the value you want.
Its not ideal but it can help if you want to check certain indexes. Hopefully you would have to use it on a picker with hundreds of values ;)
Example with Date picker (UIDatePicker)
XCUIApplication().datePickers.pickerWheels.elementBoundByIndex(0).adjustToPickerWheelValue("March")
XCUIApplication().datePickers.pickerWheels.elementBoundByIndex(1).adjustToPickerWheelValue("24")
XCUIApplication().datePickers.pickerWheels.elementBoundByIndex(2).adjustToPickerWheelValue("2000")
And here is example with Picker view (UIPickerView)
XCUIApplication().pickerWheels.element.adjustToPickerWheelValue("Male")

scoll in select option disabled after using jqtransform

I have a problem with Jqtransform , when it transform the select input , it disable scrolling on the option value and make it appear very long drop down selection
like in the image i attached ![enter image description here][1]
i need help please
Thanks
http://imm.io/pi0d
jquery.jqtransform.js
add this code -> .css('height', 120)
line=265
looks like
var $ul = $('ul',
$wrapper).css('width',$select.width()).css('height', 120).hide();
Rather than giving height to it I would suggest give it an overflow-y:scroll
var $ul = $('ul', $wrapper).css('width',$select.width()).css('overflow-y', 'scroll').hide();
Let the height be given through CSS and not through JS...
Hope this helps :)

Telerik MVC grid-How to set default row selected

Is it possible to render a Grid with one row selected as default (set the right page number and highlight the row)?
For highlighting, try using the "OnRowDataBound" event
.ClientEvents(events => events.OnRowDataBound("onRowDataBound"))
with something like
function onRowDataBound(e) {
var myId = $('#MyId').val();
if (e.dataItem.Id == myId)
e.row.className = 't-state-selected';
}
I'm still trying to figure out how to set the correct initial page number. This bloke might be on to something.
Use the Grid RowAction method, eg:
.RowAction(row => row.Selected = row.DataItem.CustomerCode.Equals(ViewBag.ID))
It is perhaps possible if you iterate in the grid source, locate the row which has to be selected in it, than use a formula to detect on which page will be displayed, and finally change the page index on initial load and select it.

Resources