Fix iPad PDF scroll issue - detect iOS and open in new tab

This commit is contained in:
TheMaddax 2025-12-19 17:44:14 -07:00
parent 400678f4af
commit 159ce11eb8
2 changed files with 13 additions and 8 deletions

View file

@ -15,10 +15,10 @@ class DatabaseSeeder extends Seeder
*/
public function run(): void
{
// Call specific seeders instead of using factories
$this->call([
AdminSeeder::class,
V1DataMigrationSeeder::class,
]);
// Migration complete - no automatic seeding
// Data is already in production database
// Only seed manually if needed:
// php artisan db:seed --class=AdminSeeder
// php artisan db:seed --class=V1DataMigrationSeeder
}
}

View file

@ -45,9 +45,14 @@ const openDocument = (doc: Document, event: MouseEvent) => {
const documentUrl = `/api/documents/${doc.id}/download`;
// On mobile (< 768px), open PDF directly in new tab
// On desktop, use modal viewer
if (window.innerWidth < 768) {
// Detect iOS devices (iPhone, iPad, iPod)
// Modern iPads report as MacIntel, so check for touch points
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) ||
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
// On mobile (< 768px) or iOS devices, open PDF directly in new tab
// On desktop (non-iOS), use modal viewer
if (window.innerWidth < 768 || isIOS) {
window.open(documentUrl, '_blank');
} else {
selectedDocument.value = {