Hello again,
I had asked a similar question in the past, but I am trying to figure out how to accomplish the following.
Ideally – at least for my understanding – in cases of range number inputs, the fields should start empty, only with a placeholder – for example prices using as placeholders ‘from’ and ‘to’, and the filter should actually be used only if something is input and use ‘defaults’ 0 and infinity – aka bring all results back if not used. Like a select for example, if you don’t select a value, it simply doesn’t execute. The defaults would be used in case someone for example only inputs a ‘max’ value.
I can’t really figure out how to mess with the input object of a range input – how do you access any of the values there? I created a filter but it doesn’t change anything. How do you change the default max for example? Some code would be really helpful! (I have successfully manipulated various other kinds of input objects, eg for range selects, but this doesn’t seem to work).
So, what I am looking for:
– input range starts with two EMPTY inputs. I would expect if there aren’t any values, then the filter doesn’t execute – this is default behavior – so bring every result back
– if something is input in both fields, then cool, filter than
– if someone enters something only on min input, use ‘default max’ a huge number to ‘fake’ infinity
– if someone enters something only on max input, use ‘default min’ equal to 0
So I guess the problem starts from the input fields being pre-filled. The back end adds 0 value to both inputs if no value is set, so I guess if the input object can be manipulated to start empty, maybe we have a chance on this.