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

parser-input-select clears inputs if column isn't sortable, filterable & parseable #1833

Open
JamoCA opened this issue Dec 17, 2022 · 0 comments

Comments

@JamoCA
Copy link

JamoCA commented Dec 17, 2022

I encountered an issue where the parser-input-select.js library was being loaded globally on all administrative pages. Some INPUT fields were being cleared during blur/change events. These input fields became uneditable and were being automatically reset to original values whenever losing focus. (I was using a button in the last column to trigger JS to collect data & perform an ajax request to update back to the server.)

WORKAROUND: This bad behavior disappears only after explicitly removing filter-false, sorter-false and parser-false classes from the related column in the header row.

The version identified within the parser-input-select.js file is "2018-07-10 (v2.30.7)". I downloaded the latest code and noticed that it downloaded the dist version (no non-min files) and the patches performed on 2022-02-18 weren't included. I was hoping the inputs in the column would be ignored by the parser-input-select library entirely if parse-false were added to the column, but it has the same effect as no filter/sorter (ie, it reset the input to original value).

Is this how it's supposed to work? ie, non-filter/sort/parse inputs become uneditable? If so, is this referenced anywhere? I couldn't find anything and is the primary reason why I'm posting this issue. (I noticed that the #1809 patch indicates "Clarify use".)

<script>
$(function(){
	$('#test').tablesorter();
});
</script>

<table id="test" class="tablesorter">
	<thead>
		<tr>
			<th>ID</th>
			<th class="filter-false sorter-false">Uneditable</th>
			<th>Editable</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td>1</td>
			<td><input type="text" name="uneditable_1" value=""></td>
			<td><input type="text" name="editable_1" value=""></td>
		</tr>
		<tr>
			<td>2</td>
			<td><input type="text" name="uneditable_2" value="Testing"></td>
			<td><input type="text" name="editable_2" value=""></td>
		</tr>
	</tbody>
</table>
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

1 participant