Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combobox selected method #8

Closed
tmnyoni opened this issue Jul 11, 2021 · 1 comment
Closed

Combobox selected method #8

tmnyoni opened this issue Jul 11, 2021 · 1 comment

Comments

@tmnyoni
Copy link
Contributor

tmnyoni commented Jul 11, 2021

The selected method on the combobox seems to be failing. May you please attend to it.

How I used it:

widgets::combobox_builder fueltype_cbo(page, "fueltype_cbo");
{
	std::vector<widgets::combobox_specs::combobox_item> fueltypes = {
		{  "Petrol " }, {"Diesel"}
	};

	fueltype_cbo()
		.items(fueltypes)
		.selected("Petrol")
		.color_fill({ 255,255,255,0 })
		.rect().size(200, 25)
		.snap_to(fueltype_caption().rect(), snap_type::bottom, 0);
		fueltype_cbo().events().selection = [](const std::string& selected) {};
}
@alecmus
Copy link
Owner

alecmus commented Jul 11, 2021

The .selected property checks for an exact match, including leading or trailing whitespace. The code above won't match because there is a trailing whitespace in "Petrol ".

@tmnyoni tmnyoni closed this as completed Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants