zoltantorok/filament-drag-and-scroll 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zoltantorok/filament-drag-and-scroll

最新稳定版本:v1.0.3

Composer 安装命令:

composer require zoltantorok/filament-drag-and-scroll

包简介

Shift + Drag to scroll Filament tables horizontally. Designed for users with basic mice or accessibility needs.

README 文档

README

Horizontal table scrolling in Filament can be frustrating, especially for users with basic mice that lack a horizontal scroll wheel, trackball users, or anyone working with accessibility needs. This package solves that problem by letting users hold Shift and drag to scroll tables horizontally with ease.

Features

  • Shift + Drag to scroll - Hold Shift and drag any table to scroll horizontally
  • Per-panel configuration - Enable for specific Filament panels using a simple method call
  • Visual feedback - Tooltip and cursor changes guide the user
  • 13 languages included - Automatic translation based on your app locale
  • Zero configuration - Install, enable, and it just works

Requirements

  • PHP ^8.1
  • Laravel ^11.0
  • Filament ^5.0

Installation

composer require zoltantorok/filament-drag-and-scroll

Usage

Add ->dragAndScroll() to your panel provider:

use Filament\Panel;
use Filament\PanelProvider;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->default()
            ->id('admin')
            ->path('admin')
            ->login()
            ->dragAndScroll();
    }
}

That's it. Your users can now hold Shift and drag to scroll any table horizontally.

Disabling

->dragAndScroll(false)

Or simply don't call the method on panels where you don't need it.

How It Works

  1. User holds Shift - the cursor changes and a tooltip appears
  2. User clicks and drags on a table - the table scrolls horizontally
  3. User releases Shift - drag mode deactivates

The interaction is designed to stay out of the way. It doesn't interfere with normal table usage, text selection, or other Filament features.

Translations

The package uses Laravel's translation system and automatically detects your app locale. No configuration required.

Supported Languages

Language Code
English en
Spanish es
French fr
German de
Italian it
Portuguese pt
Dutch nl
Russian ru
Chinese zh
Japanese ja
Korean ko
Hungarian hu
Romanian ro

Customizing Translations

Publish the translation files to override them:

php artisan vendor:publish --tag="filament-drag-and-scroll-views"

Or create your own in resources/lang/vendor/filament-drag-and-scroll/{locale}/messages.php:

<?php

return [
    'dragToScrollHorizontally' => 'Your custom message',
    'releaseShiftToExit' => 'Your custom exit message',
];

Publishing Assets

Assets are registered automatically. If you need to publish them manually:

php artisan vendor:publish --tag="filament-drag-and-scroll-assets" --force

Contributing

Contributions are welcome! Feel free to submit a pull request.

Credits

License

The MIT License (MIT). Please see LICENSE for more information.

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固