문제

I want a Text Field to appear when a certain item is chosen from a drop-down list. I'm using a change event.

if(this.rawValue == 1){
Tolerance.presence = "visible";
}
else{
Tolerance.presence = "hidden";
}

The problem is that the Text Field presence does not change immediately when a selection is made, but only after I go back to the list box and select again (any value, not just the same one).

도움이 되었습니까?

해결책

The new value of the dropdown only registers after the change event. This means this.rawValue points to the old value of the dropdown in a change event.

Either move your script dropdown exit event or make use of the event.newText in the if conditional in the change event.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top