I edited Media Center Manual to have a search option. It works on the preview on an Android phone, and on the Browser. However, my client tells me it doesn't work on iOS (Apple). I do not have an Apple phone, so I'd like to have this area checked.
Client tells me just that it doesn't work, so I'm guessing it has to do with the events.
Below is code:
startfilter() is in a <script> in the <head>, and I know it works. All it does is calls the default Media Center Manual's refreshItems(), so assume it's a console.log("Hello World"); for now.
function startfilter(){
console.log("Hello World");
}
=========
In <body>:
<input id="audiosearchtext" type="search" />
<button id="searchbtn">Search</button>
In <Script> after Body
$("#audiosearchtext").on('keypress', function(e) {
var keyCode = e.which || e.keyCode;
if (keyCode === 13) {
e.preventDefault();
startfilter();
return false;
}
});
$("#searchbtn").bind("click vclick tap", function(e) {
startfilter();
});
===============
I use just jquery and javascript. I think Buildfire's Media Center Manual defaults to Angular, but I barely touched it
Your posted code runs fine on iOS. must be something else that is not working.
The snippet below works fine. you can use it as widget.html and ask anyone with iOS to send to you what they see.
<html>
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"></script>
<body style="margin-top:50px">
<input id="audiosearchtext" type="search" />
<button id="searchbtn">Search</button>
<p id="result">
Keys:
</p>
</body>
<script>
function startfilter(){
document.getElementById("result").innerHTML += "Enter Recieved" + "<br/>";
}
$("#audiosearchtext").on('keypress', function(e) {
var keyCode = e.which || e.keyCode;
document.getElementById("result").innerHTML += keyCode + "<br/>";
if (keyCode === 13) {
startfilter();
e.preventDefault();
return false;
}
});
$("#searchbtn").bind("click vclick tap", function(e) {
startfilter();
});
</script>
</html>