DatePicker won't allow date change when inside WhileTrue on iOS


#1

I’m using a WhileTrue to display a DatePicker for the user to choose a date.

I am able to change dates and select those within the min and max range on Android but I cannot change any dates on iOS.

I setup a little test example below:

<App>
    <JavaScript>
	var Observable = require('FuseJS/Observable');

	var show = Observable(true);

	function swap() {
		if (show.value) show.value = false;
		else show.value = true;
	}

	var pickedDateText = Observable("");

	var selectedDate = Observable();

	var today = new Date(Date.now());

	selectedDate.onValueChanged(module, function(date) {
		if (Object.prototype.toString.call(date) === '[object Date]')
			pickedDateText.value = new Date(Date.parse(date)).toDateString();
		else pickedDateText.value = "";
	});

	module.exports = {
		pickedDateText: pickedDateText,
		selectedDate: selectedDate,

		minDate: new Date(Date.parse('1920-01-01')),
		maxDate: today,

		swap: swap,
		show: show,
	};

    </JavaScript>
    <StackPanel>
	<WhileTrue Value="{show}">
		<NativeViewHost>
			<DatePicker MinValue="{minDate}" MaxValue="{maxDate}" Value="{selectedDate}" />
		</NativeViewHost>
	</WhileTrue>
	<Text Alignment="Center" Margin="0, 30, 0, 0" Value="{pickedDateText}" />
	<Button Text="Click me" Clicked="{swap}" />
    </StackPanel>
</App>

If the WhileTrue is removed then it works as expected.


#2

I had the same issue and I think it’s tied to this bug in fuselibs https://github.com/fuse-open/fuselibs/issues/1218


#3

Fix for this will be in fuselibs later this week. Will come out in next release